#ML }  X c0C)HCCH Mhhݩh `eCDiCD`  RyHP   * 1H0芢@) Y0.Ș`i#(PMR\ \b Pgi 0  % @ / ՠ`d   0DDԝLȀ}N@  )?HI Y0`HIJH) * J j * hJJJ )HJ h i     } YS S0 i`΢ϣ߳H J3xj2h} 1 |9 ӭ45(420 * (0241өX.`  R *i)Lvw  ~*P}E 5 LN(G E  r s k rsrL ( E LO(0d( L iE0O +)$IC  H S8 }q p h   j 8no CDLQ CFl M  LO Ri)Llk2'")*F }$F$F$F$F$ 5 )ШF/Șl]kpqС,LQ/A! Ti)Zlk@ ܬ/i)(")")k }$F$F$F 5$/L /lF@jj(LNkle$$%8(k()` R 8 ELO Ri)^>jf | NrC s } ) vw5g   enfo Glvw LQ@iLm>j FL ~Jjjjii p qEh }jlrs`LQ:$ȱ$@+[_#{ 8  Խut! ai 8   E I   ] C } H h    ˰ 8  N   Lm E  ,  [ `LQ ,/ 8 ~/  Ơ? ѩ}/  [ /Lj0?MoLn FjMqLp NklLOLQnLoMlNLO R"(+}ըHH`Q R!!  % !   / .   FȑF! /GF \H"+0+* }! F tLQnm: J~nTF1F  *n+)5! n (, n)1JJJn(n*o} I ,0  ci a oF? @ , 8,0 ʩ0H Eh   i}  D ]DmmFLQvtu`*&!*@h ] 0 ^0` c 0l$$%}()()%*&J%H,@hH hH@,h $% 8i8$(%)0hhH ]h`() c 0H c 0 h}`hhh&JJ ](ll  LQ0  /qnoHH 9 9 H H  I9  9 } Nd EH  Q8 o n  FnoL HII/ Ih8`h`Lnon`no`u F }E VEhLO/luF l0BF/lɜɛ׽hE N  b VFL FREE SECTORS C} H) *Fh ):FȽ F FC IH' 0 d  i:Fȩ/F.l`CD/08HDIC}IHȰ/F`ȱ$>.+.i ȱ$:刄H !A \ Hȱ$*?ȝ 2. ? [_{ ,0}-:) 0$:>WI  IТ,LQH  0hLd ~ t u`C ?( 0(C.` E } R =! .ti S0N EE D XC )0')AY  )ע ? 0E088FG \o}n  (HhLcL3 iJ i Lqp 0=rspnqopqlk`jZj0  j FL`H}FhȑFȽlFi0 h FFLFpvqwgneofLF pq7  G0i 0 FJJh1FqȱFpȱFk`B!}08`hEE D 8. =D}tui( TʩL`b!)    cȌaȌd b`aab}H8 hdaHcd8 cH hHH  \h hc` =Hh I8ih( t  ( t(!` L\}CJfCJfCJfCDfC` a  HII  INdh  `h  `n)8jHniPoijIjFIjFIjh` a } I 38  8H0 I  ' H LQ8j Y  8j NdY  &I &I &IHeH.p!}Iiq  `!.莿 2Jjj }.m Ȉ!m FG` ɩLQ z "} e Hi04 \ Ȍ  8 i h !`I0 `C Y8.`DOS SYS#} I  ` ~ݩ.C/`ba.m۩mѤC9 `C L] H  ,- '0 l $}, BLVDE`D1:AUTORUN.SYS8hhJ ȱHȱIȱBȱDȱEeeHHLV)  %}1*  ,,p-  0 I &  '0   Lw)l, 0  I&LD1:MEM.SAV&}E:D1:DUP.SYSTILITISE:D1:DUP.SYSTILITISE:D1:DUP.}J)1CD3:DOS.SYS n  * \*`آ R'S )ɀ@  U))% BError lo(}ading MEM.SAV or memory!  0* b*c*d*e* R Hd*JSDd*J-=e* 0c*ʈд =}MYDOS 4)}.50 -- Copyright 1988,˛Disks 1D- D: = D1: ~= =1-8.Dir of D1:-D8: *. Dir of D:A. *}Disk Directory K. Save MemoryB. Run Cartridge L. Load MemoryC. Copy File(s) M. Run at AddressD. Delete File(s) N. L+}oad MEM.SAVE. Rename File(s) O. Change Config.F. Lock File(s) P. Set DensityG. Unlock File(s) Q. Make DirectoryH. Wr,}ite DOS Files R. Pick DirectoryI. Initialize Disk S. Set RAMdisk #J. Duplicate Disk V. Set Verify Flag  ?莼-}( 0  =Select Item ( for menu):@  =ɛL)1L,*L,:W@ ,,L=No such item!.}L*, -L*, BNeed new file name! BNo drive or director0}ies allowed in new name!Lock Unlock Delete Lock which file?â-#Unlock which file?ɢ-$((H @ AQ/wDel1}ete what file?Ѣ-!((H @ ANJ =Answer 'Y' or 'N'h `B L?;(( ~=( ~= =? =Y ?Lj.H @ AhR ?2}R)L*,LM/L-Lz-File to rename, new name? @ A(9', ȱ:>0{ ПFull directory name?Z"L.Dire3}ctory to be used as 'D:'? @ A(5)L.(I: ȱޝL*, BInvalid directory!L?( 4}(0Li-File source, destination? '( @C۩2ڭ82ܭC B9'0 @(ߍeލd(DЍ( ? 9'5} A rBȱޙ':>Ȍ(C0J* .B :'ȱ/.* #,ɛȝ:' ߰ A L?,(0L*, '6}ut(:'3?&' .'Ƚ:'?&'  .ى'Q?''(#( ~= =-->' ~=7}Q =YR_o (J(  0?B݌''BK)`''utz0( >(L0L*,L?nDisk to FORMAT:8} YA B(UTލ1 =(Press for Enhanced Dns)Type to Format Drive 3: =AIYZNj[R VL9}?L*,D3:DUP.SYSDrive to write DOS files to? YAH1:*K)2J) Z wB hpJ) 2<2U:}TC٩1ة۩کL;Source, Destination (Sectors)? YA)((9'( SA)((((( @(0% =Inser;}t both disks, type = A( A((/( B(( BDrives not compatible!J(j(9'Hi''<}h(ɛy BInvalid options! @-&& @)׍&&(&&&۩ک&&&&8* <4&&&& <4=}8*8(ܭ(ݥ2C, BNot enough memory! ک&&`(Mh  & =L?&i &>}&&&mm   =  &((&թԥԍ(Ս(((( ( ((C2((?}ՠԍ((,(0"( (( =m(m( & &("L*,  ( AL4,(, =Insert DES@}TINATION disk, press =Nͼ J) b( 0K) ?((ԭ(խ( ( (((L4Drive, new density:A} YA9'ɛ BDrive unchanged.(ު90٨Ȍ(SD  ABL)xԌҭHӭ@ @ ʎӆ@B}ӭ@@ :  $ӹ @hөԥX` Aˠ =RAM disk present? =NL#8 =xlC}on or E type RAMdisk? =Aό  L   M A, A6: ' =No extra memory available!L#8L7 & & D}& =Use default config for 0)ȩ ~= =K? =NL7 =Size(K)? ? @FjFjFjFj: =Page seqE}uence? ? @o* =RAM disk drive no? = 09) `8 -8**H***) 9 Ȋ)h9 @@ʊ F}H'h(#''/'(ɛ ? @(@: 3 ʽ' L7 =Duplicated sequence number!L7 =Wrong numbG}er of entries!L7K큅쀄 =Verify WRITEs? ; =NumberH} of File Buffers? ? @  6 Lw),R( ';L*,Drive number or : =ɛLC99L60Ȍ( =Remove I}drive? =Y =Is drive configurable? =YЂ =High capacity drive? =Yy =Is drive double sided? =Y ; =TracksJ}/side? ? @#0M P( ; =Step rate? =4/ ; ';L*, =Drive size (in sectors)? ? @H(K}h *;L*,RAM disk drive no? 8L*,Verify WRITEs? ;L*, =WNPy`(`(  LABSAVE:filename,start,end(,init(L},run)) @TUH @Cp` 2< @؆8օڊ BInvalid START-END range!۩ @  @M} hԄՠAμȌZ wB04*  0$ڍXۍY֍T׍U,0LBLB #CL?ֆ׌`Load MEM.SAV from whaN}t file? 0#L*,L?Load from what file?) @TU&̩Z wB &0&-&а&𨭼INIZ'O}RV0II BNO CARTRIDGE!Ԇխ  )L?Run from what address? ?ɛ @P} BAddress must be 1-4 hex digits! BHILV n=`hh =HH` =0{a Hɛ n= n=h` nQ}=L*, = = pHH =hh`K: p `(((( i ɀ((L?(`(B'(0!HH''^R}>I^>(`^>DH(`(HI`(o5 ~= =( B( >@A (J wB0x((HHIIDDES}E B ?(CɈK(٢A ~= =( BL>(B^>((ڤ ܝHݝI VL_>L?(" B !B J) T} B(L& R XY( ?&:0H&((& ( .( & ( .(ʩ(U}`ލD&ߍEBIʎH( V0`ԩ ؠ@ȱ@ȱ)@ BError -- 128&`$8f 3AԄձG/ V}$<68i/(Ԧ`H&եԦ&&eԅheԅԊe(iL*@&&&&ԅL*@B ? 3A?*(ɛ:W}./2SX(0ȱ/.ɛ(ލ9'ި0#:Ȱ :ފ :ȱ: : CAD CAޥX}`(eޅީe߅`(` @L\A @TUȪ: BFile name not allowed!: )  i( =0+L Y}TUD BNot a disk file!(0` =Insert SOURCE disk, press =,(pӮ(A(O  1B AB1BZ} ` % 1(L/ b(de BJKO L?O` B((*(([}(`ȱޙ((:>Ȍ(`D:`OS.SYS,DOS.SYShh =L*,  VLJ C C,pLiLF#Խ٩Յ׆ \} LB`((:>Ȍ(`D:`OS.SYS,DOS.SYShh =L*,  VLJ C C,pLiLF#Խ٩Յ׆ TITLE 'Module BUILD'SUBTTL 'File BUILD.AMA';; This module;; (a) Flags all system locations ; referenced in the obje^}ct program so; they can be transferred to the sys-; tem equate section of the output; file;; (b) Builds a table of lab_}els for ; all non-system address references;;;;;;PROCBUILDLDA #1STA PASSJSR GETBYT ;Get a byte from object co`}de.BCS :EXIT ;Bail out if nobyte.STA INSBUF;Save it.TAXLDA MODES,X;Get mode ID.CMP #NOP;Is it an opcode?BEa}Q BUILD;No, try another one.AND #$60;Look at operand size field.BEQ BUILD;If none, forget it.JSR GETBYT;Get anotherb}BCS :EXITSTA ADRBUF;Put in address lo byteLDX INSBUF;Look at opcode again.LDA MODES,XCMP #REL;Branch?BNE :NTRLc}JSR RELADR;Yes, get the abs addrJMP BLLAB;and pass to BLLAB:NTRLCMP #IMM;Immediate mode?BEQ BUILD;Yes, try next id}nstruction;; If we get here the instruction is either absolute in; which case we need to move two operand bytes into; INSe}BUF, or 0-page in which case we want one address; byte and a zero.;AND #$40;2 operand bytes?BNE :TWOBT;Yes, read anotf}her.LDA #0;No, it's a 0P addressSTA ADRBUF+1JMP BLLAB:TWOBTJSR GETBYT;Get address hi byteBCS :EXITSTA ADRBUF+1g};; Here we examine the address at; ADRBUF(2). If it's a system loca-; tion we flag it for equate use; if; it's a previoush}ly referenced internal; address we ignore it; if it's a new internal; reference we insert the address in the ; label tablei}.;BLLABJSR GETSYS;System location?BCS :BLL1;No, try internalJSR FLGSYS;Yes, flag itJMP BUILD;and loop back.:BLLj}1JSR GETLAB;Does a label already exist?BCC BUILD;Yes, get outJSR ENTERL;No, enter it;JSR LABMSG;Pacify the operatok}rJMP BUILD;and loop back.:EXITRTS;Back to MAIN.EPROC;utJSR ENTERL;No, enter it;JSR LABMSG;Pacify the operato@TITLE 'Module START'SUBTTL 'File START.AMA';; This module resets flags, accepts user inputs, and; initializes tables anm}d pointers as required; preparatory to execution.;;;;; Here we clear the "accessed" flag on all; of the system labels.n};STARTLDX #0:CLRL1LDA PAGTAB,X;Page addr (lo)STA SYSBASINXLDA PAGTAB,X;Page addr (hi)STA SYSBAS+1INXINXLo}DA PAGTAB,X;Page topSTA ADRBUFINX:CLRL2JSR ADRSYSLDY #0LDA (SYSACC),Y;Get first byte of labelAND #$7F;Clear hip}gh bitSTA (SYSACC),Y;and put it back.DEC ADRBUFBPL :CLRL2INXCPX #[PTBEND-PAGTAB]BCC :CLRL1;; Initialize this aq}nd that;LDA #LOW LABBASSTA LABTOPLDA #HIGH LABBASSTA LABTOP+1LDA #0STA LABCNTSTA LABCNT+1STA FILSZSTA FILSr}Z+1LDX #3:CLRHDSTA HEADER,XDEXBPL :CLRHDSTA I2OPENSTA PROPENSTA PROPTSTA FREEZELDA #$FFSTA DSKOPTLDX #5s} ;Init line numbersLDA #' 'STA NUMBUF,XDEXLDA #'0':CLRLNSTA NUMBUF,XDEXBPL :CLRLNJSR CLRLAB;Clear the extet}rnal reference map;; Assume no disk present in drive;LDA #$FFSTA DISKID;; Display the opening logo;:ST1LDX #0;Seu}lect IOCB 0STX CRSINHLDA #PUTCHRSTA ICCOM,XLDA LOGOLSTA ICBLL,XSTX ICBLH;Only works with IOCB 0STX TWODR;Assuv}me one disk driveLDA #LOW LOGOSTA ICBAL,XLDA #HIGH LOGOSTA ICBAH,XJSR CIOV;Display itJSR GETMSG;Get replyLDA w}KBBUF;Nr of drivesCMP #'1'BEQ :ST2CMP #'2'BNE :ST1;Bad input, try againLDA #1;Indicate 2 drivesSTA TWODR:ST2x}LDX #0 ;Ask for input sourceLDA #PUTCHRSTA ICCOM,XLDA MSG1LSTA ICBLL,XSTX ICBLHLDA #LOW MSG1STA ICBAL,XLDA #y}HIGH MSG1STA ICBAH,XJSR CIOV;Display msgLDA #0STA CRSINHJSR GETMSG;Get replyLDA KBBUF;Source IDSTA SRCTYPCz}MP #'F';File input?BNE :ST5LDA #LOW GBFIL;Set pointer for GETBYTSTA GBPTRLDA #HIGH GBFILSTA GBPTR+1;; Get input{} file name;:ST3LDX #0;IOCB 0LDA #PUTCHRSTA ICCOM,XLDA MSG2LSTA ICBLL,XSTX ICBLHLDA #LOW MSG2STA ICBAL,XLD|}A #HIGH MSG2STA ICBAH,XJSR CIOVLDA #0STA CRSINHLDA #GETRECSTA ICCOM,XLDA #$10STA ICBLL,XSTX ICBLHLDA #LOW}} INFLBFSTA ICBAL,XLDA #HIGH INFLBFSTA ICBAH,XJSR CIOV;; Now the input file name is in INFLBF.;JMP :ST60:ST5CMP~} #'S';Sector input?BEQ :ST6;YesJMP :ST40;No, try memory:ST6LDA #LOW GBSEC;Set GETBYT pointerSTA GBPTRLDA #HIGH }GBSECSTA GBPTR+1JSR CLRSEC ;Get sector list LDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG4LSTA ICBLL,XSTX ICBLHLD}A #LOW MSG4STA ICBAL,XLDA #HIGH MSG4STA ICBAH,XJSR CIOVLDA #0STA CRSINH:SCINPJSR GETMSG;Get a sector inputLD}X #0STX SECS;Clear sector IDSTX SECS+1STX SECESTX SECE+1LDA KBBUF,X;Get first reply byteCMP #EOLBNE :ST10;En}d of listJMP :SCEND:ST10JSR ASCNIB;Convert to hexBCC :ST12JMP :SCERR;Garbage, get out:ST12LDA KBBUF,XJSR ASCNIB}BCS :ST14STA KBBUF,XINXCPX #5BNE :ST12JMP :SCERR:ST14LDY #0STY SEQCMP #','BNE :ST16LDY #$FFSTA SEQJ}MP :ST18:ST16CMP #EOLBEQ :ST18JMP :SCERR:ST18INXSTX TEMPDEXDEXLDA KBBUF,XSTA SECSDEXBMI :ST1ALDA KBBU}F,XASL AASL AASL AASL AORA SECSSTA SECSDEXBMI :ST1ALDA KBBUF,XSTA SECS+1DEXBMI :ST1ALDA KBBUF,XBE}Q :ST19JMP :SCERR:ST19DEXBMI :ST1AJMP :SCERR:ST1ASECLDA SECS;Range check SECSSBC #$D1;>$2D0?LDA SECS+1SBC} #2BCC :ST20JMP :SCERR;Yes, error;; Now we have one sector number in SECS. If it's an; individual sector we flag it i}n SECMAP.;:ST20LDA SEQ ;Sector sequence?BNE :ST22;Yes, go get end sectorLDX SECS;No, process this oneLDY SECS+1}JSR MAPACCLDA SECMAP,XORA MASK,YSTA SECMAP,XJMP :SCOK;; This is a sequence, so we get the end sector.;:ST22LDX }TEMPLDA KBBUF,XJSR ASCNIBBCC :ST24JMP :SCERR:ST24LDA KBBUF,X;Find end of second fieldJSR ASCNIBBCS :ST26STA }KBBUF,XINXCPX #$10BNE :ST24JMP :SCERR:ST26CMP #EOLBEQ :ST27JMP :SCERR:ST27DEXLDA KBBUF,XSTA SECEDEXCP}X TEMPBCC :ST28LDA KBBUF,XASL AASL AASL AASL AORA SECESTA SECEDEXCPX TEMPBCC :ST28LDA KBBUF,XSTA SE}CE+1DEXCPX TEMPBCC :ST28LDA KBBUF,XBEQ :ST27AJMP :SCERR:ST27ADEXCPX TEMPBCC :ST28JMP :SCERR;; Now we ha}ve an end sector in SECE. Next we range check.;:ST28SECLDA SECE;SECE>=SECS?SBC SECSLDA SECE+1SBC SECS+1BCS :ST2}9;No, errorJMP :SCERR:ST29LDA SECE;SECE<=$2D0?SBC #$D1LDA SECE+1SBC #2BCC :ST30JMP :SCERR;No, error;; We h}ave a valid sequence, so flag the sectors in SECMAP.;:ST30LDX SECSLDY SECS+1JSR MAPACCLDA SECMAP,XORA MASK,YSTA }SECMAP,XINC SECSBNE :ST32INC SECS+1:ST32SECLDA SECE;Done?SBC SECSLDA SECE+1SBC SECS+1BCS :ST30;No, do ano}ther;; Sector input accepted, so say so;:SCOKLDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG7LSTA ICBLL,XSTX ICBLHLDA #L}OW MSG7STA ICBAL,XLDA #HIGH MSG7STA ICBAH,XJSR CIOVJMP :SCINP;Go back for another input;; Input invalid, display} error msg;:SCERRLDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG8LSTA ICBLL,XSTX ICBLHLDA #LOW MSG8STA ICBAL,XLDA #HIG}H MSG8STA ICBAH,XJSR CIOVJMP :SCINP;Try again;; Sector list is complete, so get start address;:SCENDLDX #0LDA #}PUTCHRSTA ICCOM,XLDA MSG5LSTA ICBLL,XSTX ICBLHLDA #LOW MSG5STA ICBAL,XLDA #HIGH MSG5STA ICBAH,XJSR CIOVLD}A #0STA CRSINHJSR GETMSG;; Now we interpret the KB message as a 2-byte address.;:ST36STX STARST;Clear location coun}ter init valueSTX STARST+1LDX ICBLL;Get msg sizeCPX #6BCS :SCER2;Too long, errorDEXDEXBMI :SCER2;EOL only, e}rrorLDA KBBUF,XJSR ASCNIBBCS :SCER2;Garbage, errorSTA STARSTDEXBMI :ST38LDA KBBUF,XJSR ASCNIBBCS :SCER2A}SL AASL AASL AASL AORA STARSTSTA STARSTDEXBMI :ST38LDA KBBUF,XJSR ASCNIBBCS :SCER2STA STARST+1DEXBM}I :ST38LDA KBBUF,XJSR ASCNIBBCS :SCER2ASL AASL AASL AASL AORA STARST+1STA STARST+1:ST38JMP :ST60;Sector }input done, move on;; Start address invalid, so display error msg;:SCER2LDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG8LSTA} ICBLL,XSTX ICBLHLDA #LOW MSG8STA ICBAL,XLDA #HIGH MSG8STA ICBAH,XJSR CIOVJMP :ST36;Try again;; Not file or }sector input, try memory;:ST40CMP #'M';Memory?BEQ :ST42;Yes, get inputsJMP :ST2;Input invalid, try again:ST42LDA }#LOW GBMEM;Set GETBYT pointerSTA GBPTRLDA #HIGH GBMEMSTA GBPTR+1LDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG6LSTA ICB}LL,XSTX ICBLHLDA #LOW MSG6STA ICBAL,XLDA #HIGH MSG6STA ICBAH,XJSR CIOVLDA #0STA CRSINH:ST44 JSR GETMSG;Cl}ear the addressesLDX #0STX OBJPTRSTX OBJPTR+1STX BUFTOPSTX BUFTOP+1LDA KBBUF,X;Check for valid start charJSR A}SCNIBBCC :ST46JMP :MERR:ST46LDA KBBUF,X;Convert to hexJSR ASCNIBBCS :ST47;Found the comma?STA KBBUF,XINXCPX} #6BNE :ST46JMP :MERR;Too many characters:ST47CMP #','BNE :MERR;; We now have the start address in KBBUF in hex ni}bbles;STX TEMP;Save the comma locationLDY #0:ST48DEXBMI :ST49LDA KBBUF,XSTA STARST,Y;Right nibbleDEXBMI :S}T49LDA KBBUF,X;Left nibbleASL AASL AASL AASL AORA STARST,Y;Merge itSTA STARST,YINYCPY #2BCC :ST48;Do i}t twice;; Now we have the memory start address in STARST.;:ST49LDX TEMP;Recover the comma locationLDY #0;Excessive l}ength counterINXLDA KBBUF,XJSR ASCNIBBCS :MERR:ST50LDA KBBUF,XJSR ASCNIBBCS :ST51;Found the EOL?STA KBBUF,X}INXINYCPY #6BNE :ST50:ST51CMP #EOL;Verify EOLBNE :MERR;Found garbageLDY #0:ST52DEXCPX TEMPBEQ :MEMOK;Fi}nishedLDA KBBUF,XSTA BUFTOP,YDEXCPX TEMPBEQ :MEMOKLDA KBBUF,XASL AASL AASL AASL AORA BUFTOP,YSTA BUFT}OP,YINYCPY #2BCC :ST52;; Now we have the memory end address in BUFTOP.;:MEMOKJMP :ST60;Done with input processing}:MERRLDX #0 ;Output error msgLDA #PUTCHRSTA ICCOM,XLDA MSG8LSTA ICBLL,XSTX ICBLHLDA #LOW MSG8STA ICBAL,XL}DA #HIGH MSG8STA ICBAH,XJSR CIOVJMP :ST44;; Next ask for the output file name.;:ST60LDX #0LDA #PUTCHRSTA ICCOM},XLDA MSG3LSTA ICBLL,XSTX ICBLHLDA #LOW MSG3STA ICBAL,XLDA #HIGH MSG3STA ICBAH,XJSR CIOVLDA #0STA CRSINH};; Now get the name of the output file,append '.000'; to it,and put it in OUTFBF.;:ST62JSR GETMSG;Get output file name}BMI :ST60LDX #0LDA KBBUF,XCMP #EOLBNE :ST62ALDA #0 ;No file, turn off disk optionSTA DSKOPTJMP :ST80:ST62A}CMP #'D'BNE :ST60STA OUTFBF,XINXLDA KBBUF,XCMP #':'BNE :ST63LDA TWODRBNE :ST60LDA KBBUF,XSTA OUTFBF,XJ}MP :ST64:ST63CLCLDA TWODRADC #'1'CMP KBBUF,XBNE :ST60STA OUTFBF,XINXLDA KBBUF,XCMP #':'BNE :ST60STA OUT}FBF,X:ST64LDY #8:ST65INXDEYBMI :ST66LDA KBBUF,XSTA OUTFBF,XCMP #EOLBNE :ST65:ST66LDA #'.'STA OUTFBF,XLD}A #'0'LDY #3:ST67INXSTA OUTFBF,XDEYBNE :ST67INXLDA #EOLSTA OUTFBF,XLDA #0STA I2OPENLDA #1STA NUMFIL;}; If this is a 2-drive run, we now get the disks inserted.;:ST70LDA TWODRBEQ :ST80LDX #0LDA #PUTCHRSTA ICCOM,XL}DA MSG12LSTA ICBLL,XSTX ICBLHLDA #LOW MSG12STA ICBAL,XLDA #HIGH MSG12STA ICBAH,XLDA #1STA CRSINHJSR CIOVJ}SR GETMSG:ST80RTS;;;*********************;; ASCNIB;;*********************;; Subroutine to convert an ASCII c}haracter to; a hex nibble with validity check.;; Enter A=character;; Exit A=hex nibble (if valid); unchanged (if inv}alid);Carry=clear (if valid); set (if invalid);PROCASCNIBCMP #$47BCS :BADCMP #$2FBCC :BADCMP #$3ABCC }:CONVCMP #$41BCC :BAD:CONVSECSBC #'0'CMP #$ABCC :GOODSBC #7:GOODCLCRTS:BADSECRTS;ADCMP #$3ABCC kTITLE 'INNER DISASSEMBLY LOOP'SUBTTL 'File DSMINS.AMA';; This module actually disassembles a machine language; instruct}ion and loads the result in LINEBF.; It is called as a subroutine from DSMAIN.;DSMINSLDX INSBUF;Get the opcode.LDA MNE}IND,X;Get the mnemonic offset.TAXLDY #2DSMIN1LDA MNETEX,X ;Move mnemonic to LINEBFSTA LINEBF+7,YDEXDEYBPL DSM}IN1;; The mnemonic is in LINEBF. Now we insert the operand.;JSR OPERA;Does this mean go to the opera?RTS;Now LINEBF} contains a; complete assembly-language instruction.;;; Subroutine to insert the operand into LINEBF.;PROCOPERALDX I}NSBUF;Get opcodeLDA MODES,X;Get mode byteAND #$1F;Mask out mode IDTAX;Index operand subroutine tableLDA OPERS,X};Get subroutine addressSTA TEMP;load in pointerINXLDA OPERS,XSTA TEMP+1JMP (TEMP);And go there.;:IMPOPLDA #EOL};Implied modeSTA LINEBF+10RTS;Easy, wasn't it?;:ACCOPLDA #'A';Accumulator modeSTA LINEBF+11LDA #EOLSTA LINEB}F+12RTS;Not much harder;:IMMOPLDA #'#';Immediate modeSTA LINEBF+11LDA #'$'STA LINEBF+12LDX #13LDA INSBUF+1};Get immediate byteJSR WRTHEX;Output itLDA #EOLSTA LINEBF+15RTS;Now it's getting interesting.;:RELOPLDA INSBUF+}1;Get the relative displacementSTA ADRBUFJSR RELADR;and convert to absolute.LDX #11JSR WRTOP;Write it out.JSR AD}RCOMLDA #EOLSTA LINEBF,XRTS;:ABSOPLDA INSBUF+1;Get addressSTA ADRBUF ;Pass it to WRTOPLDA INSBUF+2STA ADR}BUF+1LDX #11JSR WRTOP ;And write it out.JSR ADRCOMLDA #EOLSTA LINEBF,XRTS;:XOPLDA INSBUF+1STA ADRBUFLDA} INSBUF+2STA ADRBUF+1LDX #11JSR WRTOPLDA #','STA LINEBF,XINXLDA #'X'STA LINEBF,XINXJSR ADRCOMLDA #EOL}STA LINEBF,XRTS;:YOPLDA INSBUF+1STA ADRBUFLDA INSBUF+2STA ADRBUF+1LDX #11JSR WRTOPLDA #','STA LINEBF,XIN}XLDA #'Y'STA LINEBF,XINXJSR ADRCOMLDA #EOLSTA LINEBF,XRTS;:ZPOPLDX #11;Index operandLDA #0STA ADRBUF+1};Zero high byteLDA INSBUF+1STA ADRBUFJSR WRTOP:ZPXITJSR ADRCOMLDA #EOLSTA LINEBF,XRTS;:ZPXOPLDX #11LDA #0}STA ADRBUF+1LDA INSBUF+1STA ADRBUFJSR WRTOP:ZPXXTLDA #','STA LINEBF,XINXLDA #'X'STA LINEBF,XINXJSR ADRCO}MLDA #EOLSTA LINEBF,XRTS;:ZPYOPLDX #11LDA #0STA ADRBUF+1LDA INSBUF+1STA ADRBUFJSR WRTOP:ZPYXTLDA #','S}TA LINEBF,XINXLDA #'Y'STA LINEBF,XINXJSR ADRCOMLDA #EOLSTA LINEBF,XRTS;:INDOPLDA #'('STA LINEBF+11LDA }INSBUF+1STA ADRBUFLDA INSBUF+2STA ADRBUF+1LDX #12JSR WRTOPLDA #')'STA LINEBF,XINXJSR ADRCOMLDA #EOLSTA }LINEBF,XRTS;:INXOPLDA #'('STA LINEBF+11LDA INSBUF+1STA ADRBUFLDA #0STA ADRBUF+1LDX #12JSR WRTOPINXLDA }#','STA LINEBF,XINXLDA #'X'STA LINEBF,XINXLDA #')'STA LINEBF,XINXJSR ADRCOMLDA #EOLSTA LINEBF,XRTS;}:INYOPLDA #'('STA LINEBF+11LDA INSBUF+1STA ADRBUFLDA #0STA ADRBUF+1LDX #12JSR WRTOPLDA #')'STA LINEBF,XI}NXLDA #','STA LINEBF,XINXLDA #'Y'STA LINEBF,XINXJSR ADRCOMLDA #EOLSTA LINEBF,XRTS;;;; Vector table to} operand subroutines.;OPERSDW :IMPOP,:ACCOP,:IMMOP,:RELOPDW :ABSOP,:XOP,:YOP,:ZPOPDW :ZPXOP,:ZPYOP,:INDOPDW :INXOP,:}INYOPEPROCtines.;OPERSDW :IMPOP,:ACCOP,:IMMOP,:RELOPDW :ABSOP,:XOP,:YOP,:ZPOPDW :ZPXOP,:ZPYOP,:INDOPDW :INXOP,:TITLE 'SYSTEM EQUATES'SUBTTL 'File SYSEQU.AMA';; Outputs a list of referenced system equates; to the source-code file.};PROCSYSEQULDA #LOW STR1 ;Get comment stringSTA STRACCLDA #HIGH STR1STA STRACC+1LDX #0JSR WRTSTR ;Output it}LDA #EOLSTA LINEBF,XJSR RECOUTLDX #0:LP1LDA PAGTAB,X;Identify a system pageSTA SYSBASINXLDA PAGTAB,XSTA SYSB}AS+1INXLDA PAGTAB,XSTA PAGNO;Page nr we are onINXLDA PAGTAB,XSTA PAGTOP;How many labels on pageINXINXTXA}PHA;Save X; Now we have the system page base address in SYSBAS(2),; page number in PAGNO, page length in PAGTOP,; and X} (now the LINEBF pointer) saved on the stack.JSR :PAGEQ;Do equates for this pagePLATAX;Recover XCPX #[PTBEND-PAGTA}B]BCC :LP1;More pages to doLDA #LOW STR2;"End of equates" commentSTA STRACCLDA #HIGH STR2STA STRACC+1LDX #0JS}R WRTSTR;Output itLDA #EOLSTA LINEBF,XJSR RECOUTRTS;; Private subroutine to output equates for 1 page;; Enter SY}SBAS(2)=system page base address; No exit parameters. No registers guaranteed.;:PAGEQLDA #0 ;Start of pageSTA ADRBUF}:LP2JSR ADRSYS;Get label addressLDY #0LDA (SYSACC),Y ;Hi bit indicates "ref'd"BPL :NOTRF;Not referencedJSR :SYSEQ};Ref'd, output equateJSR RECOUT:NOTRFINC ADRBUFBEQ :PQXITLDA ADRBUFCMP PAGTOP;End of page?BCC :LP2;No, do anot}herBEQ :LP2:PQXITRTS;Yes, page done;; Private subroutine to output one system equate;; EnterSYSACC(2)=pointer to l}abel; PAGTAB(4) reflects present system page;(In SYSBAS,PAGNO);ADRBUF=lo byte of system address;; Exit LINEBF=one sy}stem equate pseudo-op;:SYSEQLDY #5:LP3LDA (SYSACC),YSTA LINEBF,YDEYBPL :LP3LDY #0;Clear ref bit on 1st charLD}A LINEBF,YAND #$7FSTA LINEBF,YLDA #' ';Some assemblers need this blankSTA LINEBF+6LDA #'='STA LINEBF+7;Always l}eaves at least 1 blankLDA #' 'STA LINEBF+8LDA #'$'STA LINEBF+9LDX #10;Set LINEBF pointerLDA PAGNO ;Hi byte of a}ddressBEQ :ZP;Don't output hi byte if p.0JSR WRTHEX;Output one byte as ASCII:ZPLDA ADRBUF;Lo byte of addressJSR WR}THEXLDA #EOLSTA LINEBF,XRTSEPROC;; Table of page base addresses and lengths ; for system labels;PAGTABDW SP0D}B 0,$7F,$FFDW SP2DB 2,$FF,$FFDW SP3DB 3,$4F,$FFDW SPD0RDB $D0,$13,1DW SPD0WDB $D0,$1F,0DW SPD2RDB $D2,$0F},1DW SPD2WDB $D2,$0F,0DW SPD4DB $D4,$0F,$FFDW SPE4DB $E4,$7F,$FFPTBEND= *;DB $D0,$1F,0DW SPD2RDB $D2,$0F[TITLE 'MAIN SEQUENCE'SUBTTL 'File MAIN.AMA';;******************************;; DISK DISASSEMBLER Rev 2.2;;**********}********************;; Copyright 1982 Ralph Jones.;; This program disassembles Atari (tm) machine-language; programs fro}m binary DOS files, self-booting disks,; and memory into DOS text files suitable for editing; and reassembly. All program-i}nternal address references; are given labels up to a maximum of 1023 locations.; All references to locations within the Ata}ri Operating; System are given their documented system labels.; Example: instruction 20 56 E4 disassembles as JSR CIOV.; S}ystem locations used are defined by appropriate; equate pseudo-ops and hex values of all references; are given in comments }following the instructions.;; This is the mainline program.; It simply calls the major processing; modules in sequence (w}ith some looping); and wraps up at the end of the disassembly.; This file should be named in the assembly; command; it ref}erences all the other; modules via INCLUDE pseudo-ops.;;; Changes this version:;(1) Line number option;(2) Modified z}ero-page equate handling;(3) Zero-page labels prefixed with "Z";(4) Customizing file capability;; Changes this sub-vers}ion:;Printer option improved;LIST IINCLUDE D:PROGEQU.AMA;; Init code;ORG $2500INITLDA #LOW INITSTA DOSVECHD}A #HIGH INITSTA DOSVEC+1SECLDA MEMTOPSTA MEMLOSTA APPMHISTA BUFMAXLDA MEMTOP+1SBC #1 ;Leave some space abov}e.STA MEMLO+1STA APPMHI+1STA BUFMAX+1PROCJSR CUSTOMJSR VBLANK;Set up console switch monitorMAINJSR START;Set }up tables & pointersJSR GBINIT;Initialize GETBYT:BLDLPJSR BUILD; build label & symbol; tables for one; object} code segment.LDA MORSEGBNE :BLDLP; Do the same for the; next segment.JSR SYSEQU; Output equates for; all s}ystem labels used.JSR ZPEQU; Output zero-page equatesJSR GBINIT; Initialize GETBYT.:DSLPJSR DSMAIN; Disassemble one }segment.LDA MORSEGBNE :DSLP; Repeat for next segment.JSR EXTEQUWRAPLDY #20 ; Output end pseudo-opWRAP1LDA ENDOP},YSTA LINEBF,YDEYBPL WRAP1JSR RECOUTLDX #$20; Close output fileLDA #CLOSESTA ICCOM,XJSR CIOVLDX #0 ; Di}splay "done" msgLDA #PUTCHRSTA ICCOM,XLDA MSG13LSTA ICBLL,XSTX ICBLHLDA #LOW MSG13STA ICBAL,XLDA #HIGH MSG13}STA ICBAH,XJSR CIOVJSR GETMSG; Wait for CRJMP (DOSVEC) ; Start overEPROC;; Processing ends here and can be rest}arted; with Sys Reset or .;INCLUDE D:CUSTOM.AMAINCLUDE D:VBLANK.AMAINCLUDE D:START.AMAINCLUDE D:BUILD.AMAINCL}UDE D:SYSEQU.AMAINCLUDE D:ZPEQU.AMAINCLUDE D:DSMAIN.AMAINCLUDE D:EXTEQU.AMAINCLUDE D:DSMINS.AMAINCLUDE D:SYSLABS.AM}AINCLUDE D:DISTABLE.AMAINCLUDE D:SUBRS.AMAINCLUDE D:SCREEN.AMAINCLUDE D:DISKIO.AMA;BIGBUF= * ;Big Buffer starts} hereEND $2500ABLE.AMAINCLUDE D:SUBRS.AMAINCLUDE D:SCREEN.AMAINCLUDE D:DISKIO.AMA;BIGBUF= * ;Big Buffer startsTITLE 'PROGRAM EQUATES'SUBTTL 'File PROGEQU.AMA';; Program equates.;;************************;; Page 0 (system);};************************;DOSVECEQU $0ADOSINIEQU $0CAPPMHIEQU $0EFR0EQU $D4INBUFFEQU $F3;;;********************}****;; Page 0 (non-system);;************************;ORG $80ADRBUFDS 2BFAVLDS 2BTFLGDS 1BUFMAX DS 2BUFTOPD}S 2CONSAVDS 1DBTIMDS 1DOSHDRDS 4DSKOPTDS 1FILSZDS 2FREEZEDS 1GBPTRDS 2HEADERDS 4INSBUFDS 8INSPTRDS 1I2OP}ENDS 1LABACCDS 2LABCNTDS 2LABELDS 2LABNRDS 2LABTOPDS 2OBJPTRDS 2OPRCNTDS 1OPSAVDS 1OUTPTRDS 2PAGNODS 1P}AGTOPDS 1PROPENDS 1PROPTDS 1SECEDS 2SECSDS 2SECCNTDS 2SEQDS 1SRCTYPDS 1STARDS 2STARSTDS 2SYSACCDS 2SYSB}ASDS 2SYSOFFDS 1SECTRYDS 2STRACCDS 2STRLENDS 1TEMPDS 2TEXCNTDS 1WRTFLGDS 1;;**********************;; Pag}e 2 (system);;**********************;MEMTOPEQU $02E5MEMLOEQU $02E7CRSINHEQU $02F0;;**********************;; Pa }ge 3 (system);;**********************;DUNITEQU $0301DCOMNDEQU $0302DSTATSEQU $0303DBUFLOEQU $0304DBUFHIEQU $0305 }DAUX1EQU $030ADAUX2 EQU $030BICCOMEQU $0342ICSTAEQU $0343ICBALEQU $0344ICBAHEQU $0345ICBLLEQU $0348ICBLH EQU  }$0349ICAX1EQU $034A;;***********************;; Page 4;;***********************;; This part of cassette buffe }r used for variables;ORG $0400DISKIDDS 1MORSEGDS 1NUMFILDS 1PASS DS 1TWODRDS 1LABUFDS 5;;******************* }****;; Misc (system);;***********************;CONSOLEQU $D01FFASCEQU $D8E6IFPEQU $D9AADSKINVEQU $E453CIOVE}QU $E456SETVBVEQU $E45CXITVBVEQU $E462;;Command codesOPENEQU 3GETRECEQU 5GETCHREQU 7PUTRECEQU 9PUTCHREQU $BC}LOSE EQU $CGETSECEQU $52;; AUX1 equates;OPNINEQU 4OPNOTEQU 8;EOLEQU $9BCLEAREQU $7DTABEQU$7FBELLEQU $FDS}KIPEQU $1D;ETSECEQU $52;; AUX1 equates;OPNINEQU 4OPNOTEQU 8;EOLEQU $9BCLEAREQU $7DTABEQU$7FBELLEQU $FDSTITLE 'MAIN DISASSEMBLY LOOP'SUBTTL 'File DSMAIN.AMA';; This module disassembles one segment of the object code.; It co}ntains most of the fancier analysis logic in the; program, and most of the unstructured code. Oh well...;PROCDSMAINLDA }#2STA PASS:DSMLPJSR CLRBUF ;Clear buffersJSR LINADR;Send line addr to E:,P:;; See if there's a label for this instr}uction.;LDA STARSTA ADRBUFLDA STAR+1STA ADRBUF+1:PUTLBJSR GETLABBCS :BYTE1;If not, skip ahead.LDA #1JSR FLG}LAB;Flag this label as "internal"LDX #0 ;Index output byte 0.JSR WRTLAB;Convert label nr to a ;text label and ins}ert it.:BYTE1JSR GETBYT;Get byte 1 of instruction.BCC :B1A;Get out if not there.JMP :EXIT1:B1ATAXLDA MODES,X;Loo}k at mode ID.CMP #NOP;Is it an opcode?BEQ :TEXT;No, handle as text.LDY TEXCNT;Yes, check text count.BEQ :NOTEX;No} text present,; so move on to disassembly.STX OPSAV;Save the opcode.JSR TEXOUT;Output a text instruction.;; Now we h}ave to output a line address to E:,P:.; Unfortunately the location counter is past the; first byte, so we have to back it u}p one.;SECLDA STARSBC #1STA STARLDA STAR+1SBC #0STA STAR+1JSR LINADRINC STAR ;Put counter back where it w}asBNE :B1BINC STAR+1:B1BJSR CLRBUF;Clear the buffers.LDX OPSAV;Recover the opcode.:NOTEXSTX INSBUF;Put in instru}ction buffer.INC INSPTR;Update the pointer.LDA MODES,X;Get the mode byte.AND #$60;Look at nr of operand bytes.LSR }A ;Shift it down.LSR ALSR ALSR ALSR ASTA OPRCNT;Move to operand count.AND #$02;Set up booby trap flagSTA BT}FLGLDA OPRCNT:OPLPBEQ :DSMBL;Here the Z bit must; reflect contents of OPRCNT because we either; shifted or decremented} it to get here.JSR GETBYT;Still need some oprs.BCS :EXIT2;Out of bytes, this;will become a text instruction.LDX INS }PTRSTA INSBUF,X;Put operand in buffer.INC INSPTRDEC OPRCNTJMP :OPLP;Try for another opr.;; Now we have the instru!}ction buffer full,; so let's disassemble it.;:DSMBLLDA BTFLG;Check booby trap flagBEQ :DSMB1LDA INSBUF+2BNE :DSMB1"};; Aha! We have a 2-byte address instruction but; the address is 0-page. We must be trying to; disassemble a text sequenc#}e as an instruction.; Let's put a stop to this crapola.;LDA #3STA TEXCNTJMP :TEXFL:DSMB1JSR DSMINS ;Disassemble i$}nstruction;JSR RECOUT ;Output it;JMP :DSMLP;and do it all again.;; Here we load the byte into the instruction buffer %}as a; text byte. It's in the X register.:TEXTTXALDX TEXCNT;Tells where to put it.STA INSBUF,XINC TEXCNT;; If the &}next location is labeled we must; bite off the text instruction here.;LDA STARSTA ADRBUFLDA STAR+1LDA ADRBUF+1JSR'} GETLABBCS :NOLAB;It's not labeled.:TEXFLJSR TEXOUTJMP :DSMLP;Back thru main loop.:NOLABLDA TEXCNT;See how much te(}xt we have.CMP #5 ;>=8 bytes?BCS :TEXFL;Yes, wrap it up.JMP :BYTE1;No, continue with text.;; Here we convert this)} aborted instruction to text.;:EXIT2LDX INSPTR;This is number of bytes in INSBUF.STX TEXCNT;This makes INSBUF a text l*}ine.:EXIT1LDA TEXCNT;Any text present?BEQ :EXIT0;No, get out.JSR TEXOUT;Yes, output it.:EXIT0LDA MORSEG;Any more +}segments?BEQ :BYE;No, drop out;; There is another segment to disassemble so we have; to output a set-origin pseudo. But,} first we must; see if we left a label hanging at the address that; follows the end of the current segment. If so we; just-} unflag it so it will be an external reference.;LDA LINEBF;Look at first buffer byteCMP #'L';Start of a label?BNE :E.}XIT;No, no label hereLDA #0;Yes, unflag itJSR FLGLAB:EXITJSR SETORG;Set the new origin:BYESEC ;Indicate end of /}segmentRTS ;and split.EPROC;unflag itJSR FLGLAB:EXITJSR SETORG;Set the new origin:BYESEC ;Indicate end of %TITLE 'DISK I/O MODULE'SUBTTL 'File DISKIO.AMA';; Contains subroutines to do disk I/O and supply; object code to the di1}sassembly loop.;;**********************;; GETBYT;;**********************;; Subroutine to get next unprocessed b2}yte.;PROCGETBYTJMP (GBPTR);Vector to source-dependent; object code input routine.;GBMEMLDA PA3}SS ;Code for memory inputCMP #2;Pass 2?BNE :GBM1;No, move onJSR SETORG;Yes, set the originJSR LINADR;Repeat 4}line addressLDA #0;and see that itSTA PASS;doesn't happen again:GBM1SEC;; Any data left in the Big Buffer?;LDA B5}UFTOPSBC OBJPTRLDA BUFTOP+1SBC OBJPTR+1BCS :GBM2;Yes, go get it.LDA #0;No, so say soSTA MORSEGSEC;Indicate 6}failureRTS;And get out.:GBM2LDY #0LDA (OBJPTR),Y;Get the byteTAX;Save itINC OBJPTR;Step this counterBNE :GB7}M4INC OBJPTR+1:GBM4INC STAR ;and locatin counterBNE :GBM6INC STAR+1:GBM6TXA;Recover byteCLC ;Indicate success8}RTS;;GBFILSEC ;Code for DOS file input.;; Any data left in the Big Buffer?;LDA BUFTOPSBC OBJPTRLDA BUFTOP+19}SBC OBJPTR+1BCS :GBF2;Yes, go get a byte.JSR GOFIL;No, go get some more.BCC :GBF2;Got some dataLDA #0;File is emp:}tySTA MORSEG;so say so.RTS ;Exit with carry set.;; There is data available in the Big Buffer; but we have to do some;} interpretation yet.;:GBF2LDA HEADER+2;This is nr of bytes; remaining in the current file section. Is it 0?BNE :GBF8;<}No, go get the next one.LDA HEADER+3BNE :GBF8LDA #0STA MORSEG;; Yes, see if there's another section in the file.;=}; Here we read the next 4 bytes from the Big Buffer; and extract the section address/length information.; These 4 bytes mus>}t be present because we already; know there is at least 1 byte, and GOFIL will not; load them if there isn't room for all 4?}.;LDY #3:GBF4LDA (OBJPTR),YSTA HEADER,YDEYBPL :GBF4;; Now move OBJPTR up 4 bytes to jump over the header info.;@}CLCLDA OBJPTRADC #4STA OBJPTRLDA OBJPTR+1ADC #0STA OBJPTR+1;; Now test the new section for contiguity with thA}e last.;LDA HEADER;Section start addressCMP STAR;Disassembly location counterBNE :GBF6;Not equal, reset counterLDB}A HEADER+1CMP STAR+1BEQ :GBF8;Equal, section is contiguous;; Set the location counter to the start of the new section.C};:GBF6LDA HEADERSTA STARLDA HEADER+1STA STAR+1LDA #$FFSTA MORSEGSEC;Return without reading a byte.RTS;; D}At last we go get the damn byte.;:GBF8LDY #0LDA (OBJPTR),YTAX;Save the byteINC OBJPTR;Step the pointerBNE :GBF1E}0INC OBJPTR+1:GBF10CLC;Step the location counterINC STARBNE :GBF11INC STAR+1:GBF11DEC HEADER+2;Count down nr oF}f bytes in sectionLDA HEADER+2CMP #$FFBNE :GBF12DEC HEADER+3:GBF12LDA HEADER+2BNE :GBF13LDA HEADER+3BNE :GBF1G}3STA MORSEG:GBF13TXA;Recover the byteCLC;Indicate successRTSEPROC;;;;**********************;; GOFIH}L;;**********************;; Subroutine to move more data from the source file; into the Big Buffer.;; Enter SECCNT=nr I}of unloaded bytes remaining; in the current DOS file section;; Exit BUFTOP=address of top of loaded; part of Big BufferJ};Carry=set if & only if no data got transferred;Y=error code if a disk read error occurred; PROCGOFILLDA MORSEGBK}NE :GOFOKSECRTS:GOFOKSECLDA #BIGBUF&$FFSTA OBJPTR;Reset this pointerSBC #1STA BUFTOP;and this oneLDA #BIGBUL}F/256STA OBJPTR+1SBC #0STA BUFTOP+1;; Now we have OBJPTR set equal to BIGBUF so it; points to the next byte to be prM}ocessed and; BUFTOP set to 1 less to indicate the top of; the loaded part of the Big Buffer.;; While we're at it, let's cN}ompute buffer space available.;SECLDA BUFMAXSBC BUFTOPSTA BFAVLLDA BUFMAX+1SBC BUFTOP+1STA BFAVL+1;; Now staO}rt on the disk access. First get the input; disk into the drive if required.;LDA TWODRBNE :LOOP1LDA DISKIDBEQ :LOOPP}1JSR GINDSK;Get input disk;; Get object code from a DOS file.;:LOOP1LDA SECCNT;Any data left in; current file sectiQ}on?BEQ :LP1AJMP :OLDSC;Yes, go get it.:LP1ALDA SECCNT+1BEQ :LP1BJMP :OLDSC;; This section done, so see if there'R}s room in the; Big Buffer for another section header.;:LP1BSECLDA BFAVLSBC #5LDA BFAVL+1SBC #0BCS :GF0JMP :BFS}ULL;Not enough room, get out.;; We have room for a header and at least one data byte,; so get the header.;:GF0LDX #$10T};Select IOCB 1LDA #GETCHRSTA ICCOM,X;; Set buffer length to 0 for one-byte xfer;LDA #0STA ICBLL,XSTA ICBLH,X;U}; Watch closely now.;:GF1JSR CIOV;Get 1 byte from input fileBPL :GF1AJMP :FLEND;No byte, it's EOF:GF1ASTA DOSHDRV}JSR CIOVBPL :GF1BJMP :FLEND:GF1BSTA DOSHDR+1CMP #$FF;Binary file flag?BNE :GF2;No, go on.CMP DOSHDRBEQ :GF1;W}Yes, get 2 more bytes.:GF2JSR CIOVBPL :GF2AJMP :FLEND:GF2ASTA DOSHDR+2JSR CIOVBPL :GF2BJMP :FLEND:GF2BSTA DOSX}HDR+3;; Now we have the file section start address in DOSHDR(2); and end address in DOSHDR+2(2).; Next we get the number Y}of bytes in the new section.;SECLDA DOSHDR+2;End addressSBC DOSHDR;Start addressSTA DOSHDR+2;Now section lengthZ}LDA DOSHDR+3SBC DOSHDR+1STA DOSHDR+3CLC;Have to add 1LDA DOSHDR+2;to get correct length.ADC #1STA DOSHDR+2ST[}A SECCNTLDA DOSHDR+3ADC #0STA DOSHDR+3STA SECCNT+1;; OK, now the header block has start/length information and; SE\}CCNT has the section length. With me? Now we; move the header block into the Big Buffer.;LDY #4:HDLPDEYLDA DOSHDR,Y]}INYSTA (BUFTOP),YDEYBNE :HDLP;; Now move BUFTOP up 4 bytes.;CLCLDA BUFTOPADC #4STA BUFTOPLDA BUFTOP+1ADC^} #0STA BUFTOP+1;; Now we have an active file section, so see how much; room we have in the Big Buffer.;:OLDSCSECLDA_} BUFMAXSBC BUFTOPSTA BFAVLLDA BUFMAX+1SBC BUFTOP+1STA BFAVL+1BCC :BFULLBNE :OS1LDA BFAVLBEQ :BFULL;; Now `}set up the IOCB to read SECCNT bytes.;:OS1LDX #$10;Select IOCB 1LDA SECCNTSTA ICBLL,XLDA SECCNT+1STA ICBLH,X;; a}Now see if we can get away with this.;SECLDA BFAVLSBC SECCNTLDA BFAVL+1SBC SECCNT+1BCS :GF3;Yes we can.LDA BFb}AVL ;No, only xfer BFAVL bytes.STA ICBLL,XLDA BFAVL+1STA ICBLH,X:GF3CLCLDA BUFTOP;Set buffer locationADC #1STc}A ICBAL,XLDA BUFTOP+1ADC #0STA ICBAH,XJSR CIOV;Load buffer;; Read error here will take care of itself later.; Nexd}t move BUFTOP up by byte count.;CLCLDA BUFTOPADC ICBLL,XSTA BUFTOPLDA BUFTOP+1ADC ICBLH,XSTA BUFTOP+1;; And e}move SECCNT down by the same amount.;SECLDA SECCNTSBC ICBLL,XSTA SECCNTLDA SECCNT+1SBC ICBLH,XSTA SECCNT+1;;f} And loop back for another section.;JMP :LOOP1:FLENDLDA #0STA MORSEG;Probably don't need this:BFULLSEC;This will q}F#DOS SYSF6'DUP SYS]BUILD AMANlSTART AMADSMINS AMASYSEQU AMAMAIN AMAPROGEQU AMADSMAIN AMAƘ0DISKIO AMA EXTEQU AMA`SYSLABS AMA>SCREEN AMAs\SUBRS AMADISTABLEAMA ZPEQU AMACUSTOM AMA VBLANK AMAFAMAC FOMEDIT set the carryLDA BUFTOP;if we got any dataSBC #BIGBUF&$FFLDA BUFTOP+1SBC #BIGBUF/256ROR A;and this will toggle itr}.EOR #$80ROL ARTS;;GBSECSEC;Input code for sector input.;; Any data left in the Big Buffer?;LDA BUFTOPSBC s}OBJPTRLDA BUFTOP+1SBC OBJPTR+1BCS :GBS2;Yes, go get someJSR GOSEC;No, get more from diskBCC :GBS2;Got some, so pt}rocessLDA #0 ;Disk exhaustedSTA MORSEG;so say soRTS;and get out.:GBS2LDY #0 ;Get a byteLDA (OBJPTR),YTAXu};Save itINC OBJPTR;Step this pointerBNE :GBS4INC OBJPTR+1:GBS4INC STAR;and locatin counterBNE :GBS6INC STAR+1v}:GBS6TXA;Recover byteCLC;Indicate successRTS;and exit with byte in A.;;;**********************;; GOSECw};;**********************;; Subroutine to fill the Big Buffer from a sector list.;GOSECLDA #$00STA MORSEGSECLDA #x}BIGBUF&$FFSTA OBJPTR;Reset this pointerSBC #1STA BUFTOP;and this one.LDA #BIGBUF/256STA OBJPTR+1SBC #0STA BUFy}TOP+1;; Does Big Buffer have room for another sector?;:GOS2SECLDA BUFMAXSBC BUFTOPSTA BFAVL;nr bytes avail in bufz}ferLDA BUFMAX+1SBC BUFTOP+1STA BFAVL+1SECLDA BFAVLSBC #$80;Length of a sectorLDA BFAVL+1SBC #0BCC :GOXIT;{}No room, get out.;; Buffer has room, now select a sector.;:GOS4INC SECTRYBNE :GOS6INC SECTRY+1:GOS6SEC;Out of se|}ctor numbers?LDA #$D0SBC SECTRYLDA #2SBC SECTRY+1BCC :GOXIT;Yes, get out;; See if this sector number is in the s}}ector list.;LDX SECTRYLDY SECTRY+1JSR MAPACCLDA SECMAP,XAND MASK,YBEQ :GOS4;No, try another sector;; We want ~}this sector, so go read it.;LDA TWODRBNE :GOS7LDA DISKIDBEQ :GOS7JSR GINDSK:GOS7LDA SECTRYSTA DAUX1LDA SECTR}Y+1STA DAUX2LDA #1;Drive 1STA DUNITLDA #GETSEC;Get sector commandSTA DCOMNDCLC;Start new sector oneLDA BUFT}OP;byte above BUFTOPADC #1STA DBUFLOLDA BUFTOP+1ADC #0STA DBUFHIJSR DSKINV;Read the sectorLDA DSTATS;; Need} some error trapping here;;; These NOP's form a hook for a subroutine to do; special input data processing after the sect}or; is read.;NOPNOPNOPCLC;Move BUFTOP up 128 bytesLDA BUFTOPADC #$80STA BUFTOPLDA BUFTOP+1ADC #0STA B}UFTOP+1JMP :GOS2;Go back for next sector:GOXITLDA PASS;Is this pass 2?CMP #2BNE :GOSX2JSR SETORG;Output ORG pseu}do-opJSR LINADR;Repeat the line addressLDA #0STA PASS:GOSX2SECLDA BUFTOP;This sets carry ifSBC #BIGBUF&$FF;we g}ot any dataLDA BUFTOP+1SBC #BIGBUF/256ROR A;and this toggles it.EOR #$80ROL ARTSEPROC;;;;*****************}****;; RECOUT;;*********************;; Subroutine to output one record from the source line; buffer to the selec}ted output devices.;; Enter LINEBF contains 1 assembly-language instruction;; No exit parameters;PROCRECOUTLDA LNFLA}G;Want line numbers?BEQ :RE2;NoJSR LNNUM;Yes, put one in NUMBUF:RE2LDA DSKOPT;Write disk?BNE :RE3;YesJMP :NODS}K;No, skip it:RE3LDA TWODR;1 or 2 disk drives?BNE :RE4;1LDA DISKID;2, which one do we have?CMP #1BEQ :RE4;Outp}ut disk, go onJSR GOPDSK;Input disk, get the other:RE4LDA I2OPEN;Is IOCB2 open?BNE :RE6;YesJSR OPENO;No, open it};; Is there room in the current output file for; another record?;:RE6SECLDA FILSZSBC MAXSZLDA FILSZ+1SBC MAXSZ+1}BCC :RE8;Yes, send it on outJSR NEWFIL;No, open a new file;; Now output the instruction to the current output file.;}:RE8LDX #$20;IOCB2JSR CIORECBPL :RE10JMP :RERROR:RE10CLCLDA FILSZ;Update length of fileADC ICBLL,XSTA FILSZ}LDA FILSZ+1ADC ICBLH,XSTA FILSZ+1:NODSKLDA FREEZE;Freeze selected?BNE :NODSK;Yes, wait hereLDX #0 ;No, push }onJSR CIOREC;Put record to screenLDX #$30;IOCB3 for printerLDA PROPT;Printer option?BEQ :NOPR;NoLDA PROPEN;Pri}nter open?BNE :PRINT;YesLDA #OPEN;No, open itSTA ICCOM,XLDA #OPNOTSTA ICAX1,XLDA #LOW :PBUFSTA ICBAL,XLDA #}HIGH :PBUFSTA ICBAH,XJSR CIOVBPL :OPNOKJSR PHFFTLDX #0STX PROPTLDX #$30JMP :CLOSE:OPNOKLDA #$FF ;Signal }successSTA PROPENJMP :EXIT;Don't print till next time:PRINTJSR CIORECBPL :EXITLDA #$FFSTA FREEZEJMP :EXIT:NOP}RLDA PROPEN;Printer still open?BEQ :EXIT;NoJSR CIOREC;Yes, wrap up current line:CLOSELDA #CLOSE;and close itSTA }ICCOM,XJSR CIOVLDA #0STA PROPEN:EXITRTS:RERRORJMP IOERR;Failure exit point:PBUFDB 'P:';Name buffer;; Subrouti}ne to output one record from buffer; pointed to by OUTPTR to the selected IOCB;CIORECLDA #PUTRECSTA ICCOM,XLDA OUTPTR}STA ICBAL,XLDA OUTPTR+1STA ICBAH,XLDA #$80STA ICBLL,XLDA #0STA ICBLH,XJSR CIOVRTSEPROC;;***************}***;; NEWFIL;;******************;; Subroutine to close the current output file (because; full) and open a new one.};PROC;; First find where in OUTFBF the extender starts.;NEWFILLDX #1:NF2INXCPX #$0FBNE :NF3JMP :NFERR:NF3LD}A OUTFBF,XCMP #'.'BNE :NF2STX TEMP;Save offset to periodINX;Get offset to last digitINXINXSTX TEMP+1;Save t}his offset;; Now we add 1 to the extender by ASCII addition (!);:NF4LDY OUTFBF,XINYCPY #':'BCC :NF6LDA #'0'STA} OUTFBF,XDEXCPX TEMP;Finished?BNE :NF4;No, do another digit:NF6TYASTA OUTFBF,X;; Now the new extender is in the} file name in OUTFBF.; Next we merge the file name into the LINK instruction.;LDY #6:NF8INY;Find end of pseudo-opLD}A LINKBF,YCMP #$27;Quote?BEQ :NF10CMP #' ';Space?BEQ :NF9CPY #$12;No, try againBNE :NF8JMP :NFERR;Couldn't }find end:NF9INY ;Look at next charLDA LINKBF,YCMP #$27;Quote?BEQ :NF10;YesCMP #'#';#?BEQ :NF10;YesDEY };No, use last charLDA LINKBF,Y:NF10PHA;Save last char of pseudo-opLDX #$FF:NF12INXINYLDA OUTFBF,X;Merge file }nameSTA LINKBF,YCPX TEMP+1;Offset to final char in filenmBNE :NF12INYPLA;Recover space, quote or #CMP #$27BN}E :NF14STA LINKBF,Y;Insert if quoteINY:NF14LDA #EOL;Terminate recordSTA LINKBF,Y;; Now the link instruction is in} LINKBF but we may; need a line number.;LDA LNFLAGBEQ :NOLNLDX #$20;Output contents of NUMBUFLDA #PUTCHRSTA ICCO}M,XLDA #LOW NUMBUFSTA ICBAL,XLDA #HIGH NUMBUFSTA ICBAH,XLDA #6STA ICBLL,XLDA #0STA ICBLH,XJSR CIOVJSR LNN}UM;Update the line number;;Now output the file link to the old file to wrap it up.;:NOLNLDX #$20LDA #PUTRECSTA ICCO}M,XLDA #$80STA ICBLL,XLDA #0STA ICBLH,XLDA #LOW LINKBFSTA ICBAL,XLDA #HIGH LINKBFSTA ICBAH,XJSR CIOVBMI :}NFERR;;Close the old file;LDA #CLOSESTA ICCOM,XJSR CIOVBMI :NFERRLDA #0STA I2OPEN;; See if output disk is fu}ll & if so get it changed.;INC NUMFILLDA NUMFILCMP MAXFILBCC :NF16LDA #1STA CRSINHLDX #0LDA #PUTCHRSTA ICC}OM,XLDA MSG14LSTA ICBLL,XSTX ICBLHLDA #LOW MSG14STA ICBAL,XLDA #HIGH MSG14STA ICBAH,XJSR CIOVJSR GETMSGLD}A #1STA NUMFIL:NF16JSR OPENO;Open new fileLDA #0STA FILSZSTA FILSZ+1RTS:NFERRJMP IOERR;Failure exit pointEP}ROC;;*******************;; OPENO;;*******************;; Subroutine to open an output file named in OUTFBF;PRO}COPENOLDX #$20;IOCB2LDA #OPENSTA ICCOM,XLDA #LOW OUTFBFSTA ICBAL,XLDA #HIGH OUTFBFSTA ICBAH,XLDA #OPNOTSTA} ICAX1,XJSR CIOVBPL :OPN1JMP IOERR:OPN1LDA #$FFSTA I2OPENRTSEPROC;;;********************;; GINDSK;};********************;; Subroutine to prompt user to insert the input disk.;; No enter parameters.; Exit DISKID=0 (input} disk);GINDSKLDA #1STA CRSINHLDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG10LSTA ICBLL,XSTX ICBLHLDA #LOW MSG10STA} ICBAL,XLDA #HIGH MSG10STA ICBAH,XJSR CIOVJSR GETMSGLDA #0STA DISKIDRTS;;;*********************;; GO}PDSK;;*********************;; Subroutine to prompt user to insert the output disk.;; No enter parameters.; Exit DISKID}=1 (output disk);GOPDSKLDA #1STA CRSINHLDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG11LSTA ICBLL,XSTX ICBLHLDA #MSG1}1&$FFSTA ICBAL,XLDA #MSG11/256STA ICBAH,XJSR CIOVJSR GETMSGLDA #1STA DISKIDRTS;;;*********************;;} GETMSG;;*********************;; Subroutine to accept a keyboard message from user.;; No enter parameters.; Exit }msg in KBBUF.;GETMSGLDX #0LDA #GETRECSTA ICCOM,XLDA #$20STA ICBLL,XSTX ICBLHLDA #KBBUF&$FFSTA ICBAL,XLDA #}KBBUF/256STA ICBAH,XJSR CIOVRTS;;*********************;; GBINIT;;*********************;; Subroutine to s}et appropriate pointers to initialize; GETBYT to the start of the selected data source.;PROCGBINITLDA SRCTYP;Get type }of sourceCMP #'M';Memory?BNE :GBI1LDA STARST;Yes, this will be easySTA OBJPTRSTA STARLDA STARST+1STA OBJPTR+1}STA STAR+1:GBIM1RTS;; Source must be either file or sectors, so we want the; input disk unless we have 2 drives.;:GB}I1LDA TWODRBNE :GBI2LDA DISKIDBEQ :GBI2JSR GINDSK;Ask for input disk:GBI2LDA SRCTYPCMP #'F'BNE :GBI10;; Fil}e input, so we open the file for input.;LDX #$10;IOCB1LDA #CLOSESTA ICCOM,XJSR CIOVLDA #OPENSTA ICCOM,XLDA #O}PNINSTA ICAX1,XLDA #LOW INFLBFSTA ICBAL,XLDA #HIGH INFLBFSTA ICBAH,XJSR CIOVBPL :GBI4JMP IOERR:GBI4LDA #0}STA SECCNT;Initialize dsik section countSTA SECCNT+1LDX #3:CLRHDSTA HEADER,X;And clear header blockDEXBPL :CLRHD}JMP :GBI12;; Must be sector input (error check already done);:GBI10LDA #0STA SECTRYSTA SECTRY+1LDA STARSTSTA ST}ARLDA STARST+1STA STAR+1;; Now set up buffer pointers for either file or sector; input. BUFTOP=BIGBUF-1 and OBJPTR=BIG}BUF is the; start condition for GETBYT.;:GBI12SECLDA #LOW BIGBUFSTA OBJPTRSBC #1STA BUFTOPLDA #HIGH BIGBUFSTA} OBJPTR+1SBC #0STA BUFTOP+1CLCLDA #$FFSTA MORSEGRTSEPROC;;;*******************;; IOERR;;**********}*********;; Routine to bomb the program in event of fatal I/O error;IOERRLDX #0LDA #PUTCHRSTA ICCOM,XLDA MSG9L;Ba}d new msgSTA ICBLL,XSTX ICBLHLDA #LOW MSG9STA ICBAL,XLDA #HIGH MSG9STA ICBAH,XJSR CIOVHANGJMP HANG;Loop fore}ver;;;**********************;; SETORG;;**********************;; Subroutine to output an origin-set pseudo-op.};; Enter STAR(2)=value to set origin;; Exit ORGOP(20) contains the full pseudo-op with EOL.;PROCSETORGLDX #11LDA #}'$'STA ORGOP,XINXLDY #1:LPLDA STAR,YLSR ALSR ALSR ALSR AJSR NIBASCSTA ORGOP,XINXLDA STAR,YAND #$0F}JSR NIBASCSTA ORGOP,XINXDEYBPL :LPLDA #EOLSTA ORGOP,XLDY #20:LP2LDA ORGOP,YSTA LINEBF,YDEYBPL :LP2JS}R RECOUT:OKRTSEPROC;;**********************;; PHFFT;;**********************;; Subroutine to ring the conso}le bell;PHFFTLDX #0STX ICBLLSTX ICBLHLDA #PUTCHRSTA ICCOMLDA #BELLJSR CIOVRTS;;; Miscellaneous tables & b}uffers;KBBUFDS 32SECMAPDS 90NUMBUFDS 6;; NOTE: NUMBUF & LINEBF must be contiguous;LINEBFDS 64INFLBFDS 16OUTFBF}DS 16DB 'Link file pseudo>***'LINKBFDB ' LINK 'DB ' ***'DB 'Origin set pseudo>***'ORGO}PDB ' ORG ',EOLDB '***'DB 'Assembly end pseudo>***'ENDOPDB ' .END $2075',EOL,' 'DB '***'DB '}Comment insertion flag>'DB '***'COMENTDB '1***'DB 'Line number flag>***'LNFLAGDB 0,'***'STR1DB STR1E-STR1-1DB ';S}ystem equates used'STR1E= *STR2DB STR2E-STR2-1DB ';End of system equates'STR2E= *DB 'Define Byte pseudo>***'STR3D}B STR3E-STR3-1DB '.BYTE 'STR3E= *DB '***'STR4DB STR4E-STR4-1DB ';External reference equates'STR4E= *STR5DB STR5}E-STR5-1DB ';End of external references'STR5E= *STR6DB STR6E-STR6-1DB ';Zero-page equates'STR6E= *STR7DB STR7E-ST}R7-1DB ';End of zero-page equates'STR7E= *DB '***Max file size (hex)>'DB '***'MAXSZDW $4000DB '***'DB 'Files/di}sk+1 (hex)>***'MAXFILDB 5,'***'MASKDB 1,2,4,8DB $10,$20,$40,$80LABMAPDS 128LABBASDS 204800DB '***'DB 'Files/dicTITLE 'EXTERNAL EQUATES'SUBTTL 'File EXTEQU.AMA';; This module outputs equate pseudo-ops for all; non-system address re}ferences not contained in; the disassembled program.;PROCEXTEQULDA #LOW STR4;External equates commentSTA STRACCLDA} #HIGH STR4STA STRACC+1LDX #0JSR WRTSTRLDA #EOLSTA LINEBF,XJSR RECOUTLDA LABCNTSTA LABNR;Temp storage for LA}BCNT/2LDA LABCNT+1STA LABNR+1LSR LABNR+1;Divide by 2ROR LABNRLDA #0STA LABELSTA LABEL+1:LP1INC LABEL;Pick a} labelBNE :NOCARINC LABEL+1:NOCARSECLDA LABNRSBC LABELLDA LABNR+1SBC LABEL+1BCC :WRAPLDX LABEL;See if it w}as ref'dLDY LABEL+1JSR MAPACCLDA LABMAP,XAND MASK,YBNE :LP1;Yes, try anotherLDX #0;No, output equateJSR WRTLA}BLDA #' ':LP3STA LINEBF,XINXCPX #7BCC :LP3LDA #'='STA LINEBF,XINXLDA #' 'STA LINEBF,XINXLDA #'$'STA} LINEBF,XINXLDY #1CLC ; Add 2x LABEL to LABBASLDA #LOW LABBAS ; to get LABACCADC LABEL;Inelegant, what?STA LA}BACCLDA #HIGH LABBASADC LABEL+1STA LABACC+1LDA LABACCADC LABELSTA LABACCLDA LABACC+1ADC LABEL+1STA LABACC+1}LDY #1LDA (LABACC),YBEQ :LP1;Skip hi byte if p.0JSR WRTHEXDEYLDA (LABACC),YJSR WRTHEXLDA #EOLSTA LINEBF,X}JSR RECOUTJMP :LP1;Back for another:WRAPLDA #LOW STR5;Closing commentSTA STRACCLDA #HIGH STR5STA STRACC+1LDX #}0JSR WRTSTRLDA #EOLSTA LINEBF,XJSR RECOUTRTSEPROCsing commentSTA STRACCLDA #HIGH STR5STA STRACC+1LDX #@TITLE 'SYSTEM LABELS'SUBTTL 'File SYSLABS.AMA';; Contains the table of labels for documented; system locations on pages} 0,2,3,D0,D2 and E4.; Pages D0 and D2 have dual label sets representing; read and write accesses for these hardware locatio}ns.;; System labels, page zero. Repre-; sents locations $00-$7F (128; bytes);SP0DB 'LINZBS'DB $78,1,' 'DB 'CASI}NI'DB $78,1,' 'DB 'RAMLO 'DB $78,1,' 'DB 'TRAMSZ'DB 'TSTDAT'DB 'WARMST'DB 'BOOT 'DB 'DOSVEC'DB $78,1},' 'DB 'DOSINI'DB $78,1,' 'DB 'APPMHI'DB $78,1,' 'DB 'POKMSK'DB 'BRKKEY'DB 'RTCLOK'DB $78,1,' '}DB $78,2,' 'DB 'BUFADR'DB $78,1,' 'DB 'ICCOMT'DB 'DSKFMS'DB $78,1,' 'DB 'DSKUTL'DB $78,1,' 'DB 'P}TIMOT'DB 'PBPNT 'DB 'PBUFSZ'DB 'PTEMP 'DB 'ICHIDZ'DB 'ICDNOZ'DB 'ICCOMZ'DB 'ICSTAZ'DB 'ICBALZ'DB 'ICBAHZ'}DB 'ICPTLZ'DB 'ICPTHZ'DB 'ICBLLZ'DB 'ICBLHZ'DB 'ICAX1Z'DB 'ICAX2Z'DB 'ICSPRZ'DB $78,1,' 'DB 'ICIDNO'DB '}CIOCHR'DB 'STATUS'DB 'CHKSUM'DB 'BUFRLO'DB 'BUFRHI'DB 'BFENLO'DB 'BFENHI'DB 'CRETRY'DB 'DRETRY'DB 'BUFRFL'}DB 'RECVDN'DB 'XMTDON'DB 'CHKSNT'DB 'NOCKSM'DB 'BPTR 'DB 'FTYPE 'DB 'FEOF 'DB 'FREQ 'DB 'SOUNDR'DB 'CRI}TIC'DB 'FMSZPG'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB $78,4,' 'DB $78,5,' 'DB $78,6,' 'DB '}CKEY 'DB 'CASSBT'DB 'DSTAT 'DB 'ATRACT'DB 'DRKMSK'DB 'COLRSH'DB 'TMPCHR'DB 'HOLD1 'DB 'LMARGN'DB 'RMARGN'}DB 'ROWCRS'DB 'COLCRS'DB $78,1,' 'DB 'DINDEX'DB 'SAVMSC'DB $78,1,' 'DB 'OLDROW'DB 'OLDCOL'DB $78,1,' } 'DB 'OLDCHR'DB 'OLDADR'DB $78,1,' 'DB 'NEWROW'DB 'NEWCOL'DB $78,1,' 'DB 'LOGCOL'DB 'ADRESS'DB $78,1},' 'DB 'MLTTMP'DB $78,1,' 'DB 'SAVADR'DB $78,1,' 'DB 'RAMTOP'DB 'BUFCNT'DB 'BUFSTR'DB $78,1,' '}DB 'BITMSK'DB 'SHFAMT'DB 'ROWAC 'DB $78,1,' 'DB 'COLAC 'DB $78,1,' 'DB 'ENDPT 'DB $78,1,' 'DB 'DELTA}R'DB 'DELTAC'DB $78,1,' 'DB 'ROWINC'DB 'COLINC'DB 'SWPFLG'DB 'HOLDCH'DB 'INSDAT'DB 'COUNTR'DB $78,1,' } ';; System labels page 2. Occupies all; of this page.;SP2DB 'VDSLST'DB $78,1,' 'DB 'VPRCED'DB $78,1,' 'D}B 'VINTER'DB $78,1,' 'DB 'VBREAK'DB $78,1,' 'DB 'VKEYBD'DB $78,1,' 'DB 'VSERIN'DB $78,1,' 'DB 'VS}EROR'DB $78,1,' 'DB 'VSEROC'DB $78,1,' 'DB 'VTIMR1'DB $78,1,' 'DB 'VTIMR2'DB $78,1,' 'DB 'VTIMR4'}DB $78,1,' 'DB 'VIMIRQ'DB $78,1,' 'DB 'CDTMV1'DB $78,1,' 'DB 'CDTMV2'DB $78,1,' 'DB 'CDTMV3'DB }$78,1,' 'DB 'CDTMV4'DB $78,1,' 'DB 'CDTMV5'DB $78,1,' 'DB 'VVBLKI'DB $78,1,' 'DB 'VVBLKD'DB $78,1},' 'DB 'CDTMA1'DB $78,1,' 'DB 'CDTMA2'DB $78,1,' 'DB 'CDTMF3'DB 'SRTIMR'DB 'CDTMF4'DB 'INTEMP'DB '}CDTMF5'DB 'SDMCTL'DB 'SDLSTL'DB 'SDLSTH'DB 'SSKCTL'DB $78,1,' 'DB 'LPENH 'DB 'LPENV 'DB $78,1,' 'DB $}78,2,' 'DB $78,3,' 'DB $78,4,' 'DB 'CDEVIC'DB 'CCOMND'DB 'CAUX1 'DB 'CAUX2 'DB 'TEMP 'DB 'ERRFLG'}DB 'DFLAGS'DB 'DBSECT'DB 'BOOTAD'DB $78,1,' 'DB 'COLDST'DB $78,1,' 'DB 'DSKTIM'DB 'LINBUF'DB $78,1,' } 'DB $78,2,' 'DB $78,3,' 'DB $78,4,' 'DB $78,5,' 'DB $78,6,' 'DB $78,7,' 'DB $78,8,' 'DB} $78,9,' 'DB $78,10,' 'DB $78,11,' 'DB $78,12,' 'DB $78,13,' 'DB $78,14,' 'DB $78,15,' 'DB} $78,16,' 'DB $78,17,' 'DB $78,18,' 'DB $78,19,' 'DB $78,20,' 'DB $78,21,' 'DB $78,22,' 'D}B $78,23,' 'DB $78,24,' 'DB $78,25,' 'DB $78,26,' 'DB $78,27,' 'DB $78,28,' 'DB $78,29,' '}DB $78,30,' 'DB $78,31,' 'DB $78,32,' 'DB $78,33,' 'DB $78,34,' 'DB $78,35,' 'DB $78,36,' '}DB $78,37,' 'DB $78,38,' 'DB $78,39,' 'DB 'GPRIOR'DB 'PADDL0'DB 'PADDL1'DB 'PADDL2'DB 'PADDL3'DB 'P}ADDL4'DB 'PADDL5'DB 'PADDL6'DB 'PADDL7'DB 'STICK0'DB 'STICK1'DB 'STICK2'DB 'STICK3'DB 'PTRIG0'DB 'PTRIG1'}DB 'PTRIG2'DB 'PTRIG3'DB 'PTRIG4'DB 'PTRIG5'DB 'PTRGI6'DB 'PTRIG7'DB 'STRIG0'DB 'STRIG1'DB 'STRIG2'DB 'STRI}G3'DB 'CSTAT 'DB 'WMODE 'DB 'BLIM 'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB $78,4,' 'DB $78,5,' } 'DB 'TXTROW'DB 'TXTCOL'DB $78,1,' 'DB 'TINDEX'DB 'TXTMSC'DB $78,1,' 'DB 'TXTOLD'DB $78,1,' 'DB $7}8,2,' 'DB $78,3,' 'DB $78,4,' 'DB $78,5,' 'DB 'TMPX1 'DB 'HOLD3 'DB 'SUBTMP'DB 'HOLD2 'DB 'DMASK }'DB 'TMPLBT'DB 'ESCFLG'DB 'TABMAP'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB $78,4,' 'DB $78,5,' '}DB $78,6,' 'DB $78,7,' 'DB $78,8,' 'DB $78,9,' 'DB $78,$A,' 'DB $78,$B,' 'DB $78,$C,' 'D}B $78,$D,' 'DB $78,$E,' 'DB 'LOGMAP'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB 'INVFLG'DB 'FILFLG'}DB 'TMPROW'DB 'TMPCOL'DB $78,1,' 'DB 'SCRFLG'DB 'HOLD4 'DB 'HOLD5 'DB 'SHFLOK'DB 'BOTSCR'DB 'PCOLR0'DB '}PCOLR1'DB 'PCOLR2'DB 'PCOLR3'DB 'COLOR0'DB 'COLOR1'DB 'COLOR2'DB 'COLOR3'DB 'COLOR4'DB $78,1,' 'DB $78,2},' 'DB $78,3,' 'DB $78,4,' 'DB $78,5,' 'DB $78,6,' 'DB $78,7,' 'DB $78,8,' 'DB $78,9,'  }'DB $78,10,' 'DB $78,11,' 'DB $78,12,' 'DB $78,13,' 'DB $78,14,' 'DB $78,15,' 'DB $78,16,'  } 'DB $78,17,' 'DB $78,18,' 'DB $78,19,' 'DB $78,20,' 'DB $78,21,' 'DB $78,22,' 'DB $78,23,'  } 'DB 'GLBABS'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB 'RAMSIZ'DB 'MEMTOP'DB $78,1,' 'DB 'MEMLO ' }DB $78,1,' 'DB $78,2,' 'DB 'DVSTAT'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB 'CBAUDL'DB 'CBAUDH'D }B 'CRSINH'DB 'KEYDEL'DB 'CH1 'DB 'CHACT 'DB 'CHBAS 'DB $78,1,' 'DB $78,2,' 'DB $78,3,' 'DB $78,4,'} 'DB $78,5,' 'DB 'CHAR 'DB 'ATACHR'DB 'CH 'DB 'FILDAT'DB 'DSPFLG'DB 'SSFLAG';; Page 3;SP3DB 'DDE}VIC'DB 'DUNIT ' DB 'DCOMND'DB 'DSTATS'DB 'DBUFLO'DB 'DBUFHI'DB 'DTIMLO'DB 'DUNUSE'DB 'DBYTLO'DB 'DBYTHI'}DB 'DAUX1 'DB 'DAUX2 'DB 'TIMER1'DB $78,1,' 'DB 'ADDCOR'DB 'CASFLG'DB 'TIMER2'DB $78,1,' 'DB 'TEMP1 '}DB $78,1,' 'DB 'TEMP2 'DB 'TEMP3 'DB 'SAVIO 'DB 'TIMFLG'DB 'STACKP'DB 'TSTAT 'DB 'HATABS' DB $78,1,}' ' DB $78,2,' ' DB $78,3,' ' DB $78,4,' ' DB $78,5,' ' DB $78,6,' }' DB $78,7,' ' DB $78,8,' ' DB $78,9,' ' DB $78,10,' ' DB $78,11,' ' } DB $78,12,' ' DB $78,13,' ' DB $78,14,' ' DB $78,15,' ' DB $78,16,' ' } DB $78,17,' ' DB $78,18,' ' DB $78,19,' ' DB $78,20,' ' DB $78,21,' ' } DB $78,22,' ' DB $78,23,' ' DB $78,24,' ' DB $78,25,' ' DB $78,26,' ' } DB $78,27,' ' DB $78,28,' ' DB $78,29,' ' DB $78,30,' ' DB $78,31,' ' } DB $78,32,' ' DB $78,33,' ' DB $78,34,' ' DB $78,35,' ' DB $78,36,' ' } DB $78,37,' 'DB 'ICHID 'DB 'ICDNO 'DB 'ICCOM 'DB 'ICSTA 'DB 'ICBAL 'DB 'ICBAH 'DB 'ICPTL 'DB 'ICPTH} 'DB 'ICBLL 'DB 'ICBLH 'DB 'ICAX1 'DB 'ICAX2 'DB 'ICSPR ' DB $78,1,' ' DB $78,2,' ' D}B $78,3,' ';; Page D0 (read);SPD0RDB 'M0PF 'DB 'M1PF 'DB 'M2PF 'DB 'M3PF 'DB 'P0PF 'DB 'P1PF 'DB 'P}2PF 'DB 'P3PF 'DB 'M0PL 'DB 'M1PL 'DB 'M2PL 'DB 'M3PL 'DB 'P0PL 'DB 'P1PL 'DB 'P2PL 'DB 'P3PL '}DB 'TRIG0 'DB 'TRIG1 'DB 'TRIG2 'DB 'TRIG3 ';; Page D0 (write);SPD0WDB 'HPOSP0'DB 'HPOSP1'DB 'HPOSP2'DB 'HPO}SP3'DB 'HPOSM0'DB 'HPOSM1'DB 'HPOSM2'DB 'HPOSM3'DB 'SIZEP0'DB 'SIZEP1'DB 'SIZEP2'DB 'SIZEP3'DB 'SIZEM 'DB} 'GRAFP0'DB 'GRAFP1'DB 'GRAFP2'DB 'GRAFP3'DB 'GRAFM 'DB 'COLPM0'DB 'COLPM1'DB 'COLPM2'DB 'COLPM3'DB 'COLPF0 }'DB 'COLPF1'DB 'COLPF2'DB 'COLPF3'DB 'COLBK 'DB 'PRIOR 'DB 'VDELAY'DB 'GRACTL'DB 'HITCLR'DB 'CONSOL';;Pag!}e D2 (read);SPD2RDB 'POT0 'DB 'POT1 'DB 'POT2 'DB 'POT3 'DB 'POT4 'DB 'POT5 'DB 'POT6 'DB 'POT7 'D"}B 'ALLPOT'DB 'KBCODE'DB 'RANDOM'DB 'POTGO 'DB $78,1,' 'DB 'SERIN 'DB 'IRQST 'DB 'SKSTAT'SPD2WDB 'AUDF1 '#}DB 'AUDC1 'DB 'AUDF2 'DB 'AUDC2 'DB 'AUDF3 'DB 'AUDC3 'DB 'AUDF4 'DB 'AUDC4 'DB 'AUDCTL'DB 'STIMER'DB 'SKRE$}S 'DB $78,1,' 'DB $78,2,' 'DB 'SEROUT'DB 'IRQEN 'DB 'SKCTL ';; Page D4;SPD4DB 'DMACTL'DB 'CHACTL'DB %}'DLISTL'DB 'DLISTH'DB 'HSCROL'DB 'VSCROL'DB $78,1,' 'DB 'PMBASE'DB $78,1,' 'DB 'CHBASE'DB 'WSYNC 'DB &}'VCOUNT'DB 'PENH 'DB 'PENV 'DB 'NMIEN 'DB 'NMIST ';; Page E4;SPE4DB 'EDITRV' DB $78,1,' ' D'}B $78,2,' ' DB $78,3,' ' DB $78,4,' ' DB $78,5,' ' DB $78,6,' ' DB $78(},7,' ' DB $78,8,' ' DB $78,9,' ' DB $78,10,' ' DB $78,11,' ' DB $78,12)},' ' DB $78,13,' ' DB $78,14,' ' DB $78,15,' 'DB 'SCRENV' DB $78,1,' ' *} DB $78,2,' ' DB $78,3,' ' DB $78,4,' ' DB $78,5,' ' DB $78,6,' ' DB+} $78,7,' ' DB $78,8,' ' DB $78,9,' ' DB $78,10,' ' DB $78,11,' ' DB $7,}8,12,' ' DB $78,13,' ' DB $78,14,' ' DB $78,15,' 'DB 'KEYBDV' DB $78,1,' ' -} DB $78,2,' ' DB $78,3,' ' DB $78,4,' ' DB $78,5,' ' DB $78,6,' ' .} DB $78,7,' ' DB $78,8,' ' DB $78,9,' ' DB $78,10,' ' DB $78,11,' ' D/}B $78,12,' ' DB $78,13,' ' DB $78,14,' ' DB $78,15,' 'DB 'PRINTV' DB $78,1,' 0} ' DB $78,2,' ' DB $78,3,' ' DB $78,4,' ' DB $78,5,' ' DB $78,6,' ' 1} DB $78,7,' ' DB $78,8,' ' DB $78,9,' ' DB $78,10,' ' DB $78,11,' ' 2} DB $78,12,' ' DB $78,13,' ' DB $78,14,' ' DB $78,15,' 'DB 'CASETV' DB $78,1,3}' ' DB $78,2,' ' DB $78,3,' ' DB $78,4,' ' DB $78,5,' ' DB $78,6,' 4}' DB $78,7,' ' DB $78,8,' ' DB $78,9,' ' DB $78,10,' ' DB $78,11,' ' 5} DB $78,12,' ' DB $78,13,' ' DB $78,14,' ' DB $78,15,' 'DB 'DISKIV' DB $76}8,1,' ' DB $78,2,' 'DB 'DSKINV' DB $78,1,' ' DB $78,2,' 'DB 'CIOV ' DB $78,17},' ' DB $78,2,' 'DB 'SIOV ' DB $78,1,' ' DB $78,2,' 'DB 'SETVBV' DB $78,1,' 8} ' DB $78,2,' 'DB 'SYSVBV' DB $78,1,' ' DB $78,2,' 'DB 'XITVBV' DB $78,1,' 9}' DB $78,2,' 'DB 'SIOINV' DB $78,1,' ' DB $78,2,' 'DB 'SENDEV' DB $78,1,' ' :} DB $78,2,' 'DB 'INTINV' DB $78,1,' ' DB $78,2,' 'DB 'CIOINV' DB $78,1,' ' ;} DB $78,2,' 'DB 'BLKBDV' DB $78,1,' ' DB $78,2,' 'DB 'WARMSV' DB $78,1,' ' <} DB $78,2,' 'DB 'COLDSV' DB $78,1,' ' DB $78,2,' 'DB 'RBLOKV' DB $78,1,' ' DB=} $78,2,' 'DB 'CSOPIV' DB $78,1,' ' DB $78,2,' 'DB 'VCTABL';; End of sys equates;' DBqTITLE 'Module SCREEN'SUBTTL 'File SCREEN.AMA';; This module contains text for the output messages.;;PROCLOGOLDW :L?}OGOE-LOGOLOGODB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB TAB,' 'DB $C4,$C9,$D3,$CB,$A0DB $C4,$C9,$D3,$C1,$D@}3,$D3DB $C5,$CD,$C2,$CC,$C5,$D2DB EOL,SKIP,TAB,' 'DB 'Copyright 1982 'DB 'Ralph Jones',EOLDB SKIP,SKIP,TAB,' 'DA}B 'How many DISK 'DB 'DRIVES?',EOLDB SKIP,TAB,TAB,' ',BELL:LOGOE= *;MSG1LDW :MSG1E-MSG1MSG1DB CLEAR,SKIP,SKIP,SB}KIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,SKIP,' 'DB '(F)ile, (S)ector 'DB 'or (M)emory input?'DB EOL,SKIP,SKIPDB TAB,TAB,C}' ',BELL:MSG1E= *;MSG2LDW :MSG2E-MSG2MSG2DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,SKIP,TAB,' 'DD}B 'Enter INPUT file'DB 'spec',EOL,SKIP,TABDB ' ',BELL:MSG2E= *;MSG3LDW :MSG3E-MSG3MSG3DB CLEAR,SKIP,SKIP,SKIPE}DB SKIP,SKIP,SKIP,SKIPDB SKIP,TAB,' 'DB 'Enter OUTPUT file'DB 'spec',EOL,SKIP,TABDB ' 'DB '(NO extender)'F},EOLDB SKIP,TAB,TAB,BELL:MSG3E= *;MSG4LDW :MSG4E-MSG4MSG4DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,TAG}B,' 'DB 'Enter sector list 'DB 'in HEX',EOL,SKIPDB TAB,'mn for'DB ' single sector',EOLDB TAB,' mn,pq'DB ' for sequence',EOLDB TAB,' 'DB 'to end list',EOLDB SKIP,TAB,TAB,' ',BELL:MSG4E= *;MSG5LDW I}:MSG5E-MSG5MSG5DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,' Enter program'DB ' start address in 'DB 'HEXJ}',EOL,SKIP,TAB,TABDB 'strt',EOLDB SKIP,TAB,TAB,' ',BELL:MSG5E= *;MSG6LDW :MSG6E-MSG6MSG6DB CLEAR,SKIP,SK}KIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,' Enter start, end'DB ' addresses in HEX',EOLDB SKIP,TAB,' ssss,'DB L}'eeee',EOLDB SKIP,TAB,TAB,' ',BELL:MSG6E= *;MSG7LDW :MSG7E-MSG7MSG7DB TAB,TAB,'OK',EOL,TAB,TAB,' ':MSG7EM}= *;MSG8LDW :MSG8E-MSG8MSG8DB TAB,TAB,'ERROR-NO ENTRY'DB EOL,TAB,TAB,' ',BELL:MSG8E= *;MSG9LDW :MSG9E-MSG9MSG9N}DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,SKIP,TAB,' 'DB $C6,$C1,$D4,$C1,$CCDB $A0,$C9,$AF,$CF,$A0DO}B $C5,$D2,$D2,$CF,$D2DB $A1,EOL,SKIP,TABDB 'Press to 'DB 'start over',EOL,BELL:MSG9E= *;MSG10LDW :MS10E-MSP}G10MSG10DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,TAB,' 'DB 'Insert ',$C9,$CEDB $D0,$D5,$D4,' disk'Q}DB EOL,SKIP,TAB,TABDB 'and press',EOL,SKIPDB TAB,TAB,' ',EOL,BELL:MS10E= *;MSG11LDW :MS11E-MSG11MSG11DB CR}LEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,TAB,' 'DB 'Insert ',$CF,$D5,$D4DB $D0,$D5,$D4,' disk'DB EOL,SKS}IP,TAB,TABDB 'and press',EOL,SKIPDB TAB,TAB,' ',EOL,BELL:MS11E= *;MSG12LDW :MS12E-MSG12MSG12DB CLEAR,SKIP,T}SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB ' Insert ',$C9,$CEDB $D0,$D5,$D4,' disk 'DB 'in Drive 1',EOLDB SKIP,TAB, 'and U}'DB $CF,$D5,$D4,$D0,$D5,$D4DB ' disk in Drive 2',EOLDB SKIP,TAB,' and 'DB 'press ',EOL,BELL:MS12E= *;MV}SG13LDW :MS13E-MSG13MSG13DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,TAB,' 'DB $C4,$C9,$D3,$C1DB $D3,$DW}3,$C5,$CDDB $C2,$CC,$D9,' 'DB $C3,$CF,$CD,$D0DB $CC,$C5,$D4,$C5DB EOL,SKIP,TAB, 'Press'DB ' to 'DB 'run X}again',EOL,BELL:MS13E= *;MSG14LDW :MS14E-MSG14MSG14DB CLEAR,SKIP,SKIP,SKIPDB SKIP,SKIP,SKIP,SKIPDB SKIP,TAB,' Y} 'DB $CF,$D5,$D4,$D0,$D5,$D4DB $A0,$C4,$C9,$D3,$CBDB $A0,$C6,$D5,$CC,$CCDB EOL,SKIP,TAB,' 'DB 'Insert another dZ}isk',EOLDB SKIP,TAB,' and 'DB 'press ',EOL,BELL:MS14E= *;MSG15LDW :MS15E-MSG15MSG15DB 'CREATING LABELS[}...'DB ' ':MS15E= *;EPROC',EOL,BELL:MS14E= *;MSG15LDW :MS15E-MSG15MSG15DB 'CREATING LABELS5 TITLE 'SUBROUTINES'SUBTTL 'File SUBRS.AMA';; Utility subroutine library;;;******************;; WRTOP;;****]}**************;; Writes an operand (system or internal label); into the text line buffer.;; Enter ADRBUF(2)=referenced a^}ddress; X=offset (from LINEBF) to start writing;; Exit X=offset of next available output bytePROCWRTOPTXA;Sav_}e XPHAJSR GETSYS;System label?BCS :WRT1;NoJSR ADRSYS;Yes, get its addressPLA ;and output itTAXJSR WRTSY`}SRTS:WRT1JSR GETLAB;Get label IDPLATAXJSR WRTLAB;Output itRTSEPROC;;;*******************;; ADRSYS;a};*******************;; Computes memory address of a system label.;; Enter SYSBAS(2)=page base address; ADRBUF=addb}ress lo byte; Exit SYSACC(2)=pointer to label;; Preserves X register;PROCADRSYSLDA #0STA SYSACCSTA SYSACC+1;; c}Multiply ADRBUFx6 to get offset from SYSBAS;LDY #6:LP1CLCLDA SYSACCADC ADRBUFSTA SYSACCLDA SYSACC+1ADC #0STAd} SYSACC+1DEYBNE :LP1;; Now add it to SYSBAS;CLCLDA SYSACCADC SYSBASSTA SYSACCLDA SYSACC+1ADC SYSBAS+1STAe} SYSACC+1RTSEPROC;;;*********************;; GETSYS;;*********************;; Checks an address for system rf}eferences.;; Enter ADRBUF(2)=referenced address; Exit SYSBAS(2)=base address of system page group; ADRBUF=system ag}ddress lo byte; Carry=Clear (system location); Set (not system location);PROCGETSYSLDX #0:GS2CPX #[PTBEND-Ph}AGTAB]BCS :GSBADLDA PAGTAB,X;Sys page addr (lo)STA SYSBASINXLDA PAGTAB,X;Sys page addr (hi)STA SYSBAS+1INXLi}DA PAGTAB,X;Sys page numberSTA PAGNOINXLDA PAGTAB,X;Sys page topSTA PAGTOPINXLDA PAGTAB,X;Read/write access flj}agSTA WRTFLGINXLDA PAGNO;Look at page nrCMP ADRBUF+1;Are we on this page?BNE :GS2;No, try anotherLDA PAGTOPCk}MP ADRBUF;Within page limits?BCC :GSBAD;No, bomb outLDA WRTFLG;Yes, get page access directionBMI :GSOK;Don't care, l}go onJSR RDORWR;Get kind of instructionCMP WRTFLG;and compare with page typeBNE :GS2 ;Mismatch, go back:GSOKCLC m};SuccessRTS:GSBADSEC ;FailureRTSEPROC;;;********************;; WRTSYS;;********************;; Writn}es a system label (with offset if applicable); into the text line buffer.;; Enter SYSACC(2)=address of label;X=offset (fo}rom LINEBF) of operand;ExitX=offset of next byte;PROCWRTSYSLDY #0STY SYSOFF;Assume no offsetLDA (SYSACC),Y;Get fp}irst byteAND #$7F;Remove referenced bitCMP #'x';Offset flag?BNE :NOOFF;No, no offsetINY ;Yes, get offsetLDA (Sq}YSACC),YSTA SYSOFF;Save it;; Now we have the address in SYSACC and the offset; from the system label in SYSOFF. Next wer} have to; back up 6xSYSOFF to find the actual label.;LDY #6:MLTSSEC;Multiple subtraction loopLDA SYSACCSBC SYSOFFs}STA SYSACCLDA SYSACC+1SBC #0STA SYSACC+1DEYBNE :MLTS:NOOFFLDY #0:LP1LDA (SYSACC),Y;Move label into LINEBFAt}ND #$7F;Clear hi bitCMP #' 'BEQ :CKOFFSTA LINEBF,XINXINYCPY #6BCC :LP1:CKOFFLDA SYSOFF ;Offset?BNE :OFF;u}Yes, process itRTS;No, we're done.:OFFLDA #'+'STA LINEBF,XINXTXAPHA;Save XLDA SYSOFFSTA FR0;Convert offsv}et to ASCIILDA #0STA FR0+1JSR IFPJSR FASCPLA;Recover XTAXJSR WRTNUM;Output offsetRTS;and hang it up.;;w}********************;; GETLAB;;********************;; Computes the ID number of the internal label; represented x}by an address.;; Enter ADRBUF(2)=referenced address;; Exit LABEL(2)=label ID;Carry=Clear (label found); Set (noy} label);PROCGETLABLDA #LOW LABBAS;InitializeSTA LABACC; the label pointerLDA #HIGH LABBASSTA LABACC+1:LOOPCLCz}LDA LABACCADC #2;Step pointerSTA LABACCLDA LABACC+1ADC #0STA LABACC+1LDY #0LDA (LABACC),Y;Label address=loc c{}ounter?CMP ADRBUFBNE :NOMATINYLDA (LABACC),YCMP ADRBUF+1BNE :NOMATSEC;Yes, compute label #.LDA LABACC;Get |}table offsetSBC #LOW LABBASSTA LABELLDA LABACC+1SBC #HIGH LABBASSTA LABEL+1LSR LABEL+1;and divide by 2ROR LABE}}L;and we have the label number.:GLXITCLC;Signal successRTS;and we're done.:NOMATSEC;No matchLDA LABACC;So are~} we out of labels?SBC LABTOPLDA LABACC+1;Don't need to storeSBC LABTOP+1BCC :LOOP;No, try another.LDA #0;Yes, fl}ag the failure.STA LABELSTA LABEL+1SEC:EXIT RTS;and we're done.EPROC;;;******************;; FLGLAB;;*}*****************;; Subroutine to flag a label number as "internal"; in the label map,or to unflag it.;; Enter LABEL(2)=}label number; Acc=0 (unflag); nonzero (flag);; No exit parameters.;PROCFLGLABPHA ;Save acc keyLDX LABEL } ;Locate label flagLDY LABEL+1JSR MAPACCLDA LABMAP,XORA MASK,YSTA LABMAP,X;Set itPLA ;Get keyBNE :EXIT;F}lag, we're doneLDA LABMAP,X;UnflagEOR MASK,Y;So clear the bitSTA LABMAP,X:EXITRTSEPROC;;;******************;}; WRTLAB;;******************;; Writes an internal label into the output text buffer.;; Enter LABEL(2)=label ID;X}=offset (from LINEBF) to label; Exit X=offset to next output byte;PROCWRTLABLDA LABEL;Does a label exist?BNE :DOIT};Yes, do itLDA LABEL+1BNE :DOITLDA #'$';No, table full, enterSTA LINEBF,X;the address instead.INXLDY #1:LPLDA} ADRBUF,YJSR WRTHEXDEYBPL :LPRTS:DOITTXASTA TEMPPHA;Save XLDA LABELSTA FR0;Convert to ASCIILDA LABEL+1}STA FR0+1JSR IFPJSR FASCPLATAX;Recover X;; The label number is to be 4-digit fixed-field so; now we index to t}he 4th digit.;INXINXINXINXTXA ;Save XPHA;; Now use Y to find the index to last byte; of label nr in the FP }buffer.;LDY #$FF:LP2INYLDA (INBUFF),Y;Bit 7 set?BPL :LP2;No, try another;; Found the offset. Now move label nr t}o buffer;:LP4LDA (INBUFF),YAND #$7FSTA LINEBF,XDEXDEYBPL :LP4LDA #'0':LP6CPX TEMPBEQ :PREFSTA LINEBF,X}DEXJMP :LP6;; Now insert the label prefix: Z if zero-page,; L otherwise;:PREFLDA #'L'LDY ADRBUF+1BNE :NOTZPLDA }#'Z':NOTZPSTA LINEBF,XPLA ;Recover XTAXINX ;Index to next byteRTSEPROC;; ;********************;}; WRTNUM;;********************;; Writes an ASCII number into the output text buffer.;; Enter INBUFF(2) points to }ASCII number;X=offset (from LINEBF) to first digit; Exit X=offset to next output byte;; Note:expects ASCII number in th}e format generated; by the FP package (variable field length, high bit; set in last BCD digit).;PROCWRTNUMDEXLDY #$F}F:LP1INXINYLDA (INBUFF),Y;Get BCD digitSTA LINEBF,XBPL :LP1 ;Last byte?AND #$7F ;Yes, clear high bitSTA LINE}BF,X;and store again.INX;Index next byteRTS;and split.EPROC;;;*******************;; LNNUM;;**********}*********;; Subroutine to attach a source line number,; incrementing the current number in NUMBUF.;; No parameters.;P}ROCLNNUMLDX #3;Operate on 10's digit:LN2LDY NUMBUF,XINYCPY #':'BCC :LN4LDA #'0'STA NUMBUF,XDEXBPL :LN2:LN}4TYASTA NUMBUF,XRTSEPROC;;;*******************;; FLGSYS;;*******************;; Flags a system label to }indicate it has; been referenced.;; Enter SYSBAS(2)=system page base address;ADRBUF=address lo byte; Exit byte 0 of la}bel has high bit set;PROCFLGSYSJSR ADRSYS;Get label addressLDY #0LDA (SYSACC),Y;Get byte 0AND #$7F;Clear hi bit}CMP #'x';Offset location?BNE :NOOFFINYLDA (SYSACC),YSTA SYSOFFLDY #6:LPSECLDA SYSACCSBC SYSOFFSTA SYSACC}LDA SYSACC+1SBC #0STA SYSACC+1DEYBNE :LP:NOOFFLDY #0LDA (SYSACC),YORA #$80;Set high bitSTA (SYSACC),Y;and} restore.RTSEPROC;;;*********************;; ENTERL;;*********************;; Enters an address in the label} table.;; Enter ADRBUF(2)=address to enter; No exit params.;PROCENTERLSEC;Is label table full?LDA LABCNTSBC #LO}W[BIGBUF-LABBAS-2]LDA LABCNT+1SBC #HIGH[BIGBUF-LABBAS-2]BCS :ENXIT;; Carry must be clear;LDA LABCNT;2x nr of labe}lsADC #2;Increment itSTA LABCNTLDA LABCNT+1ADC #0STA LABCNT+1CLCLDA #LOW LABBASADC LABCNT;Add to table base}STA LABACCSTA LABTOPLDA #HIGH LABBASADC LABCNT+1STA LABACC+1STA LABTOP+1LDY #0LDA ADRBUF;Get the addressST}A (LABACC),Y;and store itINYLDA ADRBUF+1STA (LABACC),Y:ENXITRTSEPROC;;;*************************;; CLR}BUF;;*************************;; Clears instruction and text output buffers; and resets their pointers.;PROCCLRBUFL}DA #' 'LDX #35:LP1STA LINEBF,XDEXBPL :LP1LDA #0LDX #7:LP2STA INSBUF,XDEXBPL :LP2STA TEXCNTSTA INSPTRS}TA BTFLGRTSEPROC;;;*********************;; TEXOUT;;*********************;; Converts contents of INSBUF to }a text; pseudo-op and outputs it.;PROCTEXOUTLDX #7LDA #LOW STR3;Pseudo-opSTA STRACCLDA #HIGH STR3STA STRACC+1}JSR WRTSTR;Output itLDX #7 ;Find end:LP0INXCPX #$DBNE :OKLDA #' ' ;Too long, truncateSTA LINEBF,XINXL}DY #0JMP :LP1:OKLDA LINEBF,XCMP #' 'BNE :LP0INXLDY #0:LP1LDA #'$'STA LINEBF,XINXLDA INSBUF,YJSR WRTHEX}LDA #','STA LINEBF,XINXINYDEC TEXCNT;Any text left?BNE :LP1;Yes, go backDEX ;Back up oneLDA #EOL;to repl}ace final commaSTA LINEBF,XJSR RECOUT;Output itJSR CLRBUF;Clear buffersRTSEPROC;;*********************;; } WRTSTR;;*********************;; Writes a string to the text output buffer.;; Enter STRACC(2)=pointer to start of stri}ng; First byte of string=length;X=pointer to start point in output buffer;; No exit parameters.;PROCWRTSTRLDY} #0LDA (STRACC),Y;Get string lengthSTA STRLEN:LP1INYLDA (STRACC),Y;Get string byteSTA LINEBF,X;Output itINXD}EC STRLEN;Any left?BNE :LP1;Yes, go backRTS;No, doneEPROC;;********************;; WRTHEX;;*************}*******;; Writes a hex number to the output buffer in ASCII form.;; Enter Acc=hex byte;X=pointer to start point in buff}er;; Exit X=pointer to next byte in buffer;WRTHEXPHA;Save byteLSR ALSR ALSR ALSR A ;Get high nibbleJSR NI}BASC;Convert to ASCIISTA LINEBF,X;Output itINXPLA;Recover byteAND #$0F;Get lo nibbleJSR NIBASC;Convert to ASC}IISTA LINEBF,X;Output itINXRTS;;********************;; NIBASC;;********************;; Converts a hex nib}ble to an ASCII chracter.;; Enter Acc=hex nibble;; Exit Acc=ASCII byte;PROCNIBASCCLCADC #$30CMP #$3ABCC :NOAD}DCLCADC #$07:NOADDRTSEPROC;;;********************;; CLRSEC;;********************;; Subroutine to clear} active sector map;PROCCLRSECLDA #0LDX #$59;90 bytes to clear:LP1STA SECMAP,X;Clear a byteDEXBPL :LP1RTSEP}ROC;;;********************;; CLRLAB;;********************;CLRLABLDA #0LDX #127:LP1STA LABMAP,XDEXBPL }:LP1RTSEPROC;;;********************;; MAPACC;;********************;; Subroutine to access active sector/ref}erenced label maps;; Enter X,Y=sector number (lo,hi); Exit X=byte number in map;Y=bit number in byte;MAPACCLDA #0S}TA TEMP+1;Clear bit numberSTX TEMP;Sector nr (lo)TYA;Sector nr (hi)LDX #3;Divide-by-8 routineMAPAC1LSR AROR TE}MPROR TEMP+1DEXBNE MAPAC1;; Now we have byte number (=sec/8) in TEMP;LDX #5;Divide-by-32 routineMAPAC2LSR TEMP+}1DEXBNE MAPAC2;; Now we have bit number in TEMP+1;LDX TEMPLDY TEMP+1RTS;;;*********************;; RDO}RWR;;*********************;; Subroutine to determine whether a system label is; accessed by a read or write instruction.} Used in; selecting the proper system label for; hardware locations.;; Enter INSBUF=opcode oc current instruction; Exit}Z bit=set for write access; clear for read access;PROCRDORWRLDA INSBUF;Get opcodeAND #%11100111CMP #%1000011}0BEQ :WRXITCMP #%10000100BEQ :WRXITAND #%11100011CMP #%10000001BEQ :WRXITLDA #1RTS:WRXITLDA #0RTSEPROC};;;**********************;; ADRCOM;;**********************;; Writes a comment into LINEBF indicating the; add}ress referenced by a label.;; Enter ADRBUF(2) contains the address;X=LINEBF offset to start of comment;; Exit X=offset} to next available output byte;PROCADRCOMLDA COMENTBEQ :EXITLDA #' 'STA LINEBF,XINXLDA #';'STA LINEBF,XINX}LDA #'$'STA LINEBF,XINXLDY #1:LPLDA ADRBUF,YJSR WRTHEXDEYBPL :LP:EXITRTSEPROC;;;**********************};; RELADR;;**********************;; Subroutine to compute the absolute address referenced; by a branch instruct}ion.;; Enter STAR(2)=current location counter; (address of first byte after instruction);ADRBUF=branch displacem}ent;; Exit ADRBUF(2)=asolute address;PROCRELADRLDA #0STA ADRBUF+1LDA ADRBUF;Forward branch?BPL :FWD;Yes, go o}nLDA #$FF;No, fill out displacementSTA ADRBUF+1:FWDCLC;Add disp to addrLDA ADRBUFADC STARSTA ADRBUFLDA ADRBU}F+1ADC STAR+1STA ADRBUF+1RTSEPROC;;;***********************;; LABMSG;;***********************;; Subr}outine to output a screen message to; indicate label creation in progress.;; No parameters;LABMSGLDX #0LDA #PUTCHRS}TA ICCOM,XLDA MSG15LSTA ICBLL,XSTX ICBLHLDA #LOW MSG15STA ICBAL,XLDA #HIGH MSG15STA ICBAH,XJSR CIOVRTS;;*}*********************;; LINADR;;**********************;; Subroutine to output address of the current; instructi}on line to the screen and (if selected); the printer.;; Enter STAR(2)=line address;; No exit parameters.;PROCLINADR}LDX #0;Index to LABUFLDY #1:LP0LDA STAR,YLSR ALSR ALSR ALSR AJSR NIBASCSTA LABUF,XINXLDA STAR,YAND #$0}FJSR NIBASCSTA LABUF,XINXDEYBPL :LP0LDA #' 'STA LABUF,XLDX #0JSR CIOLA;Output address to E:LDA PROPT;Pr}int?AND PROPENBEQ :EXIT;NoLDX #$30;YesJSR CIOLABPL :EXITLDA #$FFSTA FREEZE:EXITRTSCIOLALDA #PUTCHRSTA I}CCOM,XLDA #5STA ICBLL,XLDA #0STA ICBLH,XLDA #LOW LABUFSTA ICBAL,XLDA #HIGH LABUFSTA ICBAH,XJSR CIOVRTSE}PROC;LDA #5STA ICBLL,XLDA #0STA ICBLH,XLDA #LOW LABUFSTA ICBAL,XLDA #HIGH LABUFSTA ICBAH,XJSR CIOVRTSETITLE 'DISASSEMBLY TABLES'SUBTTL 'File DISTABLE.AMA';; Disassembler data tables.; Table MNETEX is mnemonic text.; Tab}le MNEIND translates opcode to MNETEX offset.; Table MODES translates opcode to addressing mode ID.;; This is the table of} instruction mnemonics.;MNETEXDB 'ADCANDASLBCC'DB 'BCSBEQBITBMI'DB 'BNEBPLBRKBVC'DB 'BVSCLCCLDCLI'DB 'CLVCMPCPXCPY}'DB 'DECDEXDEYEOR'DB 'INCINXINYJMP'DB 'JSRLDALDXLDY'DB 'LSRNOPORAPHA'DB 'PHPPLAPLPROL'DB 'RORRTIRTSSBC'DB 'SECS}EDSEISTA'DB 'STXSTYTAXTAY'DB 'TSXTXATXSTYA';; This is the table of offsets to table MNETEX.; Each entry indexes the LA}ST character of its mnemonic.;MNEINDDB 32,104,255,255,255,104,8,255DB 110,104,8,255,255,104,8,255 DB 29,104,255,}255,255,104,8,255DB 41,104,255,255,255,104,8,255DB 86,5,255,255,20,5,119,255DB 116,5,119,255,20,5,119,255DB 23,5,255,}255,255,5,119,255DB 134,5,255,255,255,5,119,255DB 125,71,255,255,255,71,98,255DB 107,71,98,255,83,71,98,255DB 35,71,2}55,255,255,71,98,255DB 47,71,255,255,255,71,98,255DB 128,2,255,255,255,2,122,255DB 113,2,122,255,83,2,122,255DB 38,2,}255,255,255,2,255,255DB 140,2,255,255,255,2,255,255DB 255,143,255,255,149,143,146,255DB 68,255,161,255,149,143,146,255}DB 11,143,255,255,149,143,146,255DB 167,143,164,255,255,143,255,255DB 95,89,92,255,95,89,92,255DB 155,89,152,255,95,89},92,255DB 14,89,255,255,95,89,92,255DB 50,89,158,255,95,89,92,255DB 59,53,255,255,59,53,62,255DB 80,53,65,255,59,53,6}2,255DB 26,53,255,255,255,53,62,255DB 44,53,255,255,255,53,62,255DB 56,131,255,255,56,131,74,255DB 77,131,101,255,56,}131,74,255DB 17,131,255,255,255,131,74,255DB 137,131,255,255,255,131,74,255;; This is the table of addressing mode ID's}.; It uses the following equates:;IMPEQU $00;ImpliedACCEQU $02 ;AccumulatorIMMEQU $24;ImmediateRELEQU $}26;RelativeABSEQU $48;Absolute (JMP/JSR only)ABSREQU $48;Absolute, read accessABSWEQU $C8;Absolute, write accessXR}EQU $4A;Absolute,X,readXWEQU $CA;Absolute,X,writeYREQU $4C;Absolute,Y,readYWEQU $CC;Absolute,Y,writeZPREQU $2E;}Zero-page, readZPWEQU $AE;Zero-page,writeZPXREQU $30;Zero-page,X,readZPXWEQU $B0;Zero-page,X,writeZPYREQU $32;Zer}o-page,Y,readZPYWEQU $B2;Zero-page,Y,writeINDEQU $54;Indirect (JSR only)INDXREQU $36;Indirect,X,readINDXWEQU $B6;}Indirect,X,writeINDYREQU $38;Indirect,Y,readINDYWEQU $B8;Indirect,Y,writeNOPEQU $FF;Not an opcode;MODESDB IMP,IND}XR,NOP,NOP,NOP,ZPR,ZPW,NOPDB IMP,IMM,ACC,NOP,NOP,ABSR,ABSW,NOPDB REL,INDYR,NOP,NOP,NOP,ZPXR,ZPXW,NOPDB IMP,YR,NOP,NOP,N}OP,XR,XW,NOPDB ABS,INDXR,NOP,NOP,ZPR,ZPR,ZPW,NOPDB IMP,IMM,ACC,NOP,ABSR,ABSR,ABSW,NOPDB REL,INDYR,NOP,NOP,NOP,ZPXR,ZPXW},NOPDB IMP,YR,NOP,NOP,NOP,XR,XW,NOPDB IMP,INDXR,NOP,NOP,NOP,ZPR,ZPW,NOPDB IMP,IMM,ACC,NOP,ABS,ABSR,ABSW,NOPDB REL,IND}YR,NOP,NOP,NOP,ZPXR,ZPXW,NOPDB IMP,YR,NOP,NOP,NOP,XR,XW,NOPDB IMP,INDXR,NOP,NOP,NOP,ZPR,ZPW,NOPDB IMP,IMM,ACC,NOP,IND,A}BSR,ABSW,NOPDB REL,INDYR,NOP,NOP,NOP,ZPXR,NOP,NOPDB IMP,YR,NOP,NOP,NOP,XR,NOP,NOPDB NOP,INDXW,NOP,NOP,ZPW,ZPW,ZPW,NOP}DB IMP,NOP,IMP,NOP,ABSW,ABSW,ABSW,NOPDB REL,INDYW,NOP,NOP,ZPXW,ZPXW,ZPYW,NOPDB IMP,YW,IMP,NOP,NOP,XW,NOP,NOPDB IMM,INDX}R,IMM,NOP,ZPR,ZPR,ZPR,NOPDB IMP,IMM,IMP,NOP,ABSR,ABSR,ABSR,NOPDB REL,INDYR,NOP,NOP,ZPXR,ZPXR,ZPYR,NOPDB IMP,YR,IMP,NOP,}XR,XR,YR,NOPDB IMM,INDXR,NOP,NOP,ZPR,ZPR,ZPW,NOPDB IMP,IMM,IMP,NOP,ABSR,ABSR,ABSW,NOPDB REL,INDYR,NOP,NOP,NOP,ZPXR,ZPXW},NOPDB IMP,YR,NOP,NOP,NOP,XR,XW,NOPDB IMM,INDXR,NOP,NOP,ZPR,ZPR,ZPW,NOPDB IMP,IMM,IMP,NOP,ABSR,ABSR,ABSW,NOPDB REL,IN}DYR,NOP,NOP,NOP,ZPXR,ZPXW,NOPDB IMP,YR,NOP,NOP,NOP,XR,XW,NOP,ZPW,NOPDB IMP,IMM,IMP,NOP,ABSR,ABSR,ABSW,NOPDB REL,INCTITLE 'ZERO-PAGE EQUATES'SUBTTL 'File ZPEQU.AMA';; This module outputs equate statements; for all referenced zero-page }locations other; than system locations. These equates must be; placed at the front of the pseudo-source file; because of t}he zero-page forward reference problem; in 6502 assemblers.;PROCZPEQULDA #LOW STR6;Output opening msgSTA STRACCLDA} #HIGH STR6STA STRACC+1LDX #0JSR WRTSTRLDA #EOLSTA LINEBF,XJSR RECOUTLDA LABCNT;Store LABCNT/2STA LABNRLDA} LABCNT+1STA LABNR+1LSR LABNR+1ROR LABNRLDA #0 ;Initialize label nrSTA LABELSTA LABEL+1:LP1INC LABEL;Pick a} labelBNE :NOCARINC LABEL+1:NOCARSEC ;Out of labels?LDA LABNRSBC LABELLDA LABNR+1SBC LABEL+1BCC :WRAP;Y}es, get outCLC ;No, check this oneLDA #LOW LABBASADC LABELSTA LABACCLDA #HIGH LABBASADC LABEL+1STA LABACC+1}LDA LABACCADC LABELSTA LABACCLDA LABACC+1ADC LABEL+1STA LABACC+1LDY #1 ;Zero-page label?LDA (LABACC),YBNE} :LP1;No, try anotherLDX #0 ;Yes, format itSTA ADRBUF+1;"Z/L" logic keys on thisJSR WRTLABLDA #' ':LP4STA LINE}BF,XINXCPX #7BCC :LP4LDA #'='STA LINEBF,XINXLDA #' 'STA LINEBF,XINXLDA #'$'STA LINEBF,XINXLDY #0L}DA (LABACC),YJSR WRTHEXLDA #EOLSTA LINEBF,XJSR RECOUT;Output equateJMP :LP1;and do it again:WRAPLDA #LOW STR7;}Output closing msgSTA STRACCLDA #HIGH STR7STA STRACC+1LDX #0JSR WRTSTRLDA #EOLSTA LINEBF,XJSR RECOUTRTSEP}ROCclosing msgSTA STRACCLDA #HIGH STR7STA STRACC+1LDX #0JSR WRTSTRLDA #EOLSTA LINEBF,XJSR RECOUTRTSEPTITLE 'CUSTOMIZING MODULE'SUBTTL 'File CUSTOM.AMA';; This module reads a DISKDIS customizing file; if one is present on} Drive 1, and sets the; various customizing options to adapt DISKDIS; to the user's assembler.;PROC;; Open file if pre}sent;CUSTOMLDX #$30;IOCB3LDA #OPENSTA ICCOM,XLDA #LOW CUSFILSTA ICBAL,XLDA #HIGH CUSFILSTA ICBAH,XLDA #OPNI}NSTA ICAX1,XJSR CIOVBPL :OK0JMP :EXIT:OK0LDA #GETREC ;File link pseudoSTA ICCOM,XLDA #LOW LINKBFSTA ICBAL,X}LDA #HIGH LINKBFSTA ICBAH,XLDA #37STA ICBLL,XLDA #0STA ICBLH,XJSR CIOVBPL :OK2JMP :EXIT:OK2LDA #LOW ORGOP };Origin pseudoSTA ICBAL,XLDA #HIGH ORGOPSTA ICBAH,XLDA #21STA ICBLL,XLDA #0STA ICBLH,XJSR CIOVBPL :OK4JMP} :EXIT:OK4LDA #LOW ENDOPSTA ICBAL,XLDA #HIGH ENDOPSTA ICBAH,XLDA #20STA ICBLL,XLDA #0STA ICBLH,XJSR CIOVB}PL :OK6JMP :EXIT:OK6LDA #LOW [STR3+1];Define byte pseudoSTA ICBAL,XLDA #HIGH [STR3+1]STA ICBAH,XLDA #9STA ICBL}L,XLDA #0STA ICBLH,XJSR CIOVBMI :EXITLDA #0 ;Spare recordSTA ICBAL,XLDA #$FFSTA ICBAH,XLDA #$80STA ICB}LL,XLDA #0STA ICBLH,XJSR CIOVBMI :EXITLDA # LOW MISCBF;Misc. flagsSTA ICBAL,XLDA #HIGH MISCBFSTA ICBAH,XLD}A #10STA ICBLL,XLDA #0STA ICBLH,XJSR CIOVBMI :EXITLDA MISCBFSTA COMENTLDA MISCBF+1STA LNFLAGLDA MISCBF+2}STA MAXSZLDA MISCBF+3STA MAXSZ+1LDA MISCBF+4STA MAXFIL:EXITLDA #CLOSE;Close file & get outSTA ICCOM,XJSR CIOV}LDA LNFLAG;Want line numbers?BNE :NUMON;YesLDA #LOW LINEBF;NoSTA OUTPTRLDA #HIGH LINEBFSTA OUTPTR+1RTS:NUMON}LDA #LOW NUMBUFSTA OUTPTRLDA #HIGH NUMBUFSTA OUTPTR+1RTSMISCBFDB $31,$00;Comments on, line nrs offDW $4000;Byt}es/fileDB $05,$00;Files/disk+1,spareCUSFILDB 'D1:DISKDIS.CUS'EPROC$00;Comments on, line nrs offDW $4000;BytPTITLE 'VBI MODULE'SUBTTL 'File VBLANK.AMA';; This module creates & invokes a deferred; vertical blank interrupt routine } to monitor the; console switch status and set flags for screen; display and printer output when selected; by the operator }.;PROCVBLANKLDA #7 ; Select deferred VBILDY #LOW DVBILDX #HIGH DVBIJSR SETVBVRTS;; This is the deferred V }BI routine;DVBILDA CONSOLAND #$07EOR #$07BNE :DVB2;Switch pressedLDA DBTIM;Debounce timerBEQ :EXITDEC DBTIM }JMP :EXIT:DVB2STA CONSAVLDA DBTIMBNE :EXITLDA #5STA DBTIMLDA CONSAVAND #4BEQ :DVB4LDA PROPT ;OPTION sele}cts printerEOR #$FFSTA PROPT:DVB4LDA CONSAVAND #1BEQ :EXITLDA FREEZE ;START freezes displayEOR #$FFSTA FREE}ZE:EXITJMP XITVBVEPROCOPT:DVB4LDA CONSAVAND #1BEQ :EXITLDA FREEZE ;START freezes displayEOR #$FFSTA FREE&+&  ,&R S0Lw`&xgFmFmFmxgFm }#P? no ERRORs, 1234 Labels, $ free. Program LWA = $ *Error page 999 *Error page 999 A}TARI Macro Assembler Ver 1.0A Page 999 } hhhh#.$} OLe$ Copyright 1981} ATARI S/N-123456,Version 1.0AZ0_=S:K:?$C$T$W$P:e$B $^L.& 1lllL.&UieSQ} 1Hsete  Ueee… S gS W S D V }Uކ߆ W' G wexe& Uꆄ%" G E)@>)92k} &H 0J(& U &" G)Hme PI Q Rueƅ Q 5`Le$ Last error occurred on Page 123} Total LOST references were xâgĢxŢgƢxgpeqeres,> Mͅ΍k酯х}Ӎj҅ԍjۅ Gqe0.neoeqe!re ^,lUYe ,>ÆĆ =Li+`آM :? 80je e' 9}ئ٦ӆզԆ֬lq/[L' VHL&ÆĆ ]SæĭqeL& O(se teLi+Lc&-je`l_ }O驛LO l F|e}e )Z惠LU+L1/0L4L* 5}L*)L*L&ɢgʢ2k ( ( O( N2+>ieje)UieLn$n( 2)( 2)`FUnterminated I}F nest.IUnterminated MACRO definition.-[)𳨱)JJJ8e ]SL(ˆ̆Ÿŷ)ߑ)&)? \}Mȱeȱe eL(B) 2)L&lLQOToo many PROCs in program.0ÆŦĆƢxgL})}Ć Sg V& A 4W:æĠ``` `j*Iȱȱȱ`8 }`j VvHHdžȆ S uSdžȆ gSdžȆhh V̆!} V` 4L&L1+ 5Ɔ] ȱlL*̆ $N膖"}lƖL-' Wƀ릖0ie) VH)L* '7L)'-lL)'OLO+YLO+SLO+ELO+AlL)' 5 u> ᦅ⥚#} M ]5L(YFl΅ͅ jN HL$ > PlL-'e ALC+ GL&L-'H A* Ahl$}l ML*h ELC+:LC+ \MHH A ALC+hh gGll( H ^,hl ML* \M%} ` ML)'e'&!)ȱ)?? L>+L)'LM+ ALC+eL>+? 5 AL)',LC+&}ƲL$)L9+L)' f> V 4 &HH MhhL++ f>ئӦԥׅ & ݥHHL- f>Ӧԥ &'}놄솅 V #ݍlL++ f>)  5 &LlL++7 A7L*,P7)r7 e7L* 7 f>(}Wlye A\ >ze{e ]6 A,SlL* Ă 4WLH+: )L)'Ɇʆ)}j VOLO+ gSɦL-' :L>+ÆĆ Q ) `) 4P VH >L&EOHÆĆ)hLO+ A*[[eZe*} A-Ɣ AƊ AF/ R AULO+ȅ%ieEie A,YeZe A ALC+ HL& L@ C D F +}G I M R S >ie)@ 7H >hL)'eHH NHhh &HL&ie)@ NH HL&doeoeL/n,}eneL&ie)@ H NHh ueue ALC+ A2 RL& VH'llHH >3)hh-}ĚeLh0hh WHH 7лhh0l l QL-''L>+ Dڦl 򆊢̆e.} i( A H Ah,LC+L* W> OlLz1惥L)'HHHHH +:hhhhh8/}L$1殭Ф ELLO+ 1 2 ]S L ]SL)' FQre 6E0} V ]S`.ƮB(殠l% 2 SL2 SL)'1}L1 S S V E ȥ V ]S VL)'l%800ȹl` i2}`0 `) @` RFɢ S ` 3 7 VH 3]]HH ]S Lhh3}) LBX ȱɛ 0 SL^3 +:L&)ŭL^3lɛ 4}SL3l: L3`l`l l W V5}l3Ș Sȹl#,k(klȄLA4 S`ͅƀ8 L1+L)6}'FLO+'L1+ͥL1+ f> VL++ '7 VHͅL&ӆԆ gSӦԦ놄솅 gS릅`eՅՐe7}؅ؐ`Ll`L4醂L$NH M =5!톂ޅ߅좂 gSަ Mh8iܐ` =5 7׍ӆ8}Ԇ rel EL75l : 75 FL.EM)@% ȭȭȭ9} $)@MD) 95)< ]SLL/yeꅁ80 5Ln68充`zeye {e :}R8僅 R馂 5ꅃ)饂ye8働yeL6l^LW 6ii S;}`=l VlLW 5 >L7) Vl 7D 7 5 7A(` >$)*i<}Vl`l`eeL7ؙƀ A`l  5`l W Wݍl`l=};*ɛL8o 8k'ŁLM9 9L19!L9_-;MɛL8a{I L68>} 8慥 S惩l` } ɛ`慥𭥃HH?} +:hhL8慱 VL68惥HH 8#' 慱'@}Lo9hhHH ShhL68ŀ  89 S` 9 9`l`:A}8`,+-*/><=^& ()[]:\ S楅HHHH V z:hhhh V䃐LcE`8JLcEeB}` V` : VLB; z:eel慑 }ɛ#Ɉ?)iC}ޢ SL:eel` S ; ;L: 4Pi;8`\\\ ENDStatement MissingD}e PHɈ/*eɛȩeȩeȢe uS`ӆ;LsR HPɪLMR < -< =H} 4PL]=`xg V3 Q>"ņÆƆĆL= S V`ÆǦĆȢ 4P/$le ]= ) Q7> I}R6>M$> Q Qefef` Pass 1 - Reading Dn:FILENAME.EXTÆĆ*` f>%)?>R4 >) U%J}l` >)H AhElL_?` _? 3? ?/UYHe y?hH y?Ń h -CL> LC+le`ElL}8` ??`   de A T LALFA:L]A GȹlM}Ȅ AeL CLAr@Ɗ ALV? AS)ͅB9lO PLʆȹȹLAN}``,\)/*$+^^^&[]=<> <= >= < > ~- AND DEF EQ GT GE HIGH LE O} LOW LSTR LT MOD NE NOT OR REV SHL SHR XORƊ A )T A(NLX?LAH A  )ThL%AƊdžP}@ A : A` F C` A`护l` AƊ`8l(`ili` ALRLV?eQ}eee` A%FE۱ԅȱLA ARl` )B )B V` A%!ȥR})?B`` LB?éRl`B BƆ BŗRlBS}фB(`h`BQ$OLX?eȥeȥeȥeȌ`%יeȌ`He=YT}CL*lDDDDCCCCCDDDC`DD"D,DCDD8DEDCCCLV? A)L/D )BLC :BEELB :B%%U}LC :BLC BLB BLC B Bݰ Bְ BͰː )BL/D )BLC )BLC AV}) И)С lLC :B V DLB A AŁRl gSLC A SLoD )B SLB :B SLB :B SLBƂ0W}` gSLD :B DLB :B DLD VLV?&HH S gS恰hh gS S` V VX}䢰ʆ8ʆ`nEL)$))%)%@)%LI_})%+llɛ 򩛙lLH(sel Q(U$SQ )Q O /IlLGlɛ`})@ IlU$leT$ Que`U$P(ue)!8喰8mme @IƖ`veueũme PI܆ R8̆a}܆ Vwexe膂 Uwexeuewexewexe Uۆ @I @Ib @Ib}L@I d2ʩke)88儰ƈ` Kl RlHH Khhc}ň wKL`Q ȑH)shU* **D**ne惢 V惦Ŷd} W WL[Kmȩaȩcȩ Șe惩)LLƖLJ wKL~JL/I SFm:)e}  ]S V`FmHH ]SŅ籠ŷhh`hhт LKL L VHHLKf} ȱ VąȱL/L ͢lLL U/#)惑g}Hȱh Uiͥ)Ш wK GДň wKL~J)ie) :?`ue)HH E h}hh`wehhȥ`텂 V` gS gS gS gSԆk gS`څ Mi}Ӧ` \M ` \M `H놄솅 BM Mh M놄솅LM BM릅쥉):XeL Ojjk ]S V Nj}솅jj` 4)XeL Okj k NƔ厙k`)PXeL O Njjk᎜jk}⎝j N`)"XeL OC$ `Q`kʊmjjjijiijC$ `Qjjj莘jjk``l}`Device timeout (Doesn't respond).Device not acknowledging.B VC0`ɀL;Ɋ OLOɋ ;OLO8`m}) @L ) `Ȧ *iLXLXLYHɆ}Z RhLX ` -k-k-k-kL*`LX*iLX`PRNOBJ}9  99 99 999999 .BYTE.END}.PAGE#.SKIP*.WORD=ADCaAND!ASLASSERT)BCCBCSBEQBIT$BMI0BNEBPLBRKBVCPBVSpCLCCL}DCLIXCLVCMPCPXCPYDBE@DBDCEADCDECDEXDEYDSDWECHO(EJECT,ELSE/ENDM.endm.ENDIF}/ENDENTRYEORAEPROC%EQU ERR- EXT IDENT"IF/INCLUDE'INCL'INCINXINYJMPLJSR LDALDXLDYL}INK&LIST$LOCLSRBMACRO(MSG+NOPORAORGPAGE,PHAHPHPPLAhPLP(PROCREAL4REAL6REAL8REPT(}ROL"RORbRTI@RTS`SBCSEC8SEDSEIxSET@SPACE*STASTXSTYSUBTTLTAXTAYTITLE#TSXTXATXS}TYA USE! VFDX$X_XuX)'X:XW2XWX}XXXX000/,-B-,--BXU+-3{-|,,s,++/.,.z.L1+b/0/+>+ ^ _ }5`LdSle `vedžȆ/$ VdžȆɥʥ) C$ ;`)@) T$ ;`) Q HP}Z>$Sle P` O` ^†ue1+>T$PU$ܢQjeц҆ކߎewexeodpdke n}oFmxg? ,>ݠ d2ne`Enter source file name and options}R'S OϢ$ H 톌Sle P醌# Qh _ P< P5ee O!e~ 0e}L`ɛ eݩ8` 4P`H ShH NQh Q`H=05aH=>aLOaL=0ZaL=S:aL=P:aaL=aLaaOaPSaSL'bS=0`S=abSY}bR=0bR=SbR=FbRbe dxǢg 7eLc a 7e1U` RLdȱiil`}/$ 4WLd: fc`)L` ZD$ /cL``L`T$PU$:V$W$) PL9a&$T$'$U$})%L9aZU$ /c) PL9a bjeL` bѦL`: bd _d}L d  bL`P bgdL dɀL`b2bdžȆ /cdžȆiǐ}peL`bdžȆ RLzbD1:SYSTEXT.L`)L`Lb)ve` S=.慱 T$ H} 慭H  )Th`LdHHHH chhhh 4W: c?$ c`LdD$Z c c cƀU}$ZLzc`?$LV/$:`:/$:/$.e` ɛ 者` 5`l %d} QL%9dL dKdL dCommand input errorMal-formed numberIll-formed filenamePS > 99SL < 60dXeod e }eƀLd恘od6e2 $ ,;|5ɛ1a{I LdLd6eф ɛ LdLdʼodƁodpd` }ɛL e`' "6e`6e`eodpd odrd ]S`8`ue~e=ze|ekk?kkABS # y&0LL:Dr@( d@ ` @}>*p+9*i+-6-<5KA9~,88I9E:K:P:FILENAME IS }ˠҠ//6K Q*CL+CRf*CU+CD<,CBBT,CEBc,CBFn,CEF,CBL,CEL,CC.-DLd-DB-DAj.DR_.DF.BC/}BDc0BM1BP1BW2BRU2MSU3MC2PL}2WL3IH6IT3OC16SB66SF;6SRB@6SRFE6SRVBJ6SRVFO6RL}6LMĞ6RM4EXITq4ABORT}7REOPEN 7CTS6KMIKE LORENZEN'SMEMORY FULCURSOR AT ENLINE TOO LONINPUT EOUSING DEFAULTILLEGAL DEV:FILE.EXNEW FILNUMB}ER TOO BIDELIMITER ERROUNRECOGNIZED COMMANNOT COMPLETFILE LOCKEEDITOR IS CONFUSEBREAK KEY ABORSEARCH FAILECANNOT - PR}EVIOUS I/O ERROCANNOT FIND MARKED BLOCCANNOT FIND FILVERIFY (REPLACE,SKIP,QUIT)MARGIN VALUE ERROI/O ERROR }"-?N[v'''''''''((((((((((((}WARNING - LIMITED FREE SPACESOURCE FILE SIZE FREE SPACE TO AB}ORT, TO IGNORE}EDITOR CANNOT RUN - NO FREE IOCB'S TO RETURN TO DOS} PROGRAM-TEXT EDITOR } Version 1.0 For Dos 2.0 Copyright 1981, ATARIL* *LL* *Ƣ` *L\* *$} =` , *Lt* * =`ŏ *L* *`$0B *;$0;ɛ$ ƒ h8埆 ++Wƒ ++N}論L< 9ɛ,O0.* *;L* *;ōL+埆eL'+ƒ ++`Ə`Ɛ` ` ;8塅} 2;Le+ Q;`L+ +Ƣ` +$ =` , q+ =`L<ɛ ,O0M#Gš 8卅񄒩}.撄+ 2: ,e = 9L , 2: ,`ō%e ; 2;Ɛ` : :LO,}` : :`,OL<,L7 T,$0 3 3Ln,`6ɛ 9ō卦Ɛ𥩅Ȅ`$0  :*L,}ɛ j+L,` ƵOL<ɛ$0 ,ŵ+ɛ 5L, +L, *ŵ *L!-` 7- =` ,!ȱ9Mɛ}ɛ :LL-L:L< q-$ =` $L<$0L- :*$@ '.; j+LCIɛ,O0  :*L:ƒ ++L: :* , '.} , q+LCI` - $ =`LCIe$0(ɛ :*L:š印 j+= L.L:*Lj+3ɛ% *; : :LT. ;O` }:LX. :` :* <8` q-L_.`ɛ$0L,ɛ -L}.` : =4` f>ii8¥ >}…Å |=LGL0…Å |=8ą}8ąŅ :LU0eąeŅ |=eąeŅ f:LU0 :}…Å…Å f:`L< : = f> >…Å |=(x…Å |=}eąeŅƜƛ8ąŅꥩ |=`ƃƂeąeŅ}eąeŅ |=eąeŅeąeŅ f:` C3 1L2 1 1L2 =8}ii `hh` BCLOL< N2LNO7/ 2CPDNE` , 1 ;PBJ oB }L< B9P ; P0 P 3L72 J-L6B&HvH ,Ȅ B9hhO 6L+ 1L2 C3 ,L3PBJN}K V0MDNE B =GņŇ> A @Nv&ۮPȝHI VĄ 6B L ? , J-Lp3L<,,OPL<$L< T, ;P ;O} P  @O0 Pۥ f*`,OL< ,Lp4OPPХѱɛ PPłŃ L3 <,P}v&)DEȝHI B oB O OL< J-PPPP PЪ` 2=OP 9B < x5L5 2=,OL3H}H n, 3hhO! m5OO,$ 2CP! &B VBO,$ 2C!$ 2CP &B VBO$ 2C,$ 2CP &B <P 9B,P}LFD 1A \ 9B`D&E JB V M=ǩD fBl PP 9B <P 9B <$ 2C!P &BLVB} H B9hɛb$0>HɛOBHH膵 ,hhhL5H :* 5hHŒhhL5 :ɛ ;O :L< j+$` B9CL}HO 5hih =`L@L@L@L@@L@AL@ B99MO𵅛 eͻL ,6M06M`LPȄ , B9 g< i =`P} q-L|9L7ȅɅ8 s?ȅ¥Ʌåiĥi`L<ΦϥΥϐ`L}<8婅媅ś圐L<`8ũ媩ń兩` ȥL>Lk?ȥɩĩũƩǥȍ}Pɍ Pč Pō Pƍ PǍ POf ?H^hHPȭ Pɭ Pĭ Pŭ Pƭ P ? {?/ȍPɍ Pč Pō Pƍ PǍ P}ȱO {?`8`hL^? {?L>łŃॄȥLm?ņŇLm?ɛ` :ąŅ 2:}ƜƛL? ; -; ,L?`̩ͥCeʩLi˩CL >L*@ s?*J J`L<$0 T,HH 3 3hhL!@ }?$0HPu g7 < `BP V0 @=N ȩ8Q 0L%L0/O$! 2CP! &B VBOO$, 2C!P &B VBO$! C LEO$, C饟OO $, C,}PLGO 2CPJ &B0VI*H֝DOEB oB08 9BOɐOO OO)O(O